Cataloging WebSphere MQ applications with WebSphere Service Registry and Repository

This article uses a simple scenario to show you how to catalog existing an WebSphere MQ application as a service within WebSphere Service Registry and Repository.

Share:

Alan K H Lim (limkha@sg.ibm.com), WebSphere Technical Specialist, IBM

Photo of Alan LimAlan Lim is a WebSphere Technical Specialist with IBM Software Group in Singapore. He works with clients in the financial services sector on the design and implementation of IBM middleware solutions. His areas of expertise include Business Process Management, Enterprise Application Integration, and SOA. Alan holds a Bachelor of Electrical Engineering (Honours) degree from the National University of Singapore (NUS). You can contact Alan at limkha@sg.ibm.com



20 May 2009

Introduction

Cataloging IBM® WebSphere® MQ applications as services in IBM WebSphere Service Registry and Repository (hereafter called Service Registry) enables customers with existing investments in WebSphere MQ to leverage the capabilities of Service Registry to promote greater reuse, visibility, and manageability of these MQ applications. This article extends the work done in the IBM Redpaper Cataloging WebSphere MQ applications in WSDL for reuse in SOA and in the IBM article Take control of your MQ applications with WebSphere Service Registry and Repository.

In this article, you will learn how to define an MQ application as a service using the MQ Service Definition Wizard in WebSphere MQ Explorer, and how to load MQ Service definitions into Service Registry. The article will also describe the MQ objects and relationships between the various entities described in the MQ Service Definition document that are automatically built when MQ Service Definitions are loaded. Finally, the article will explain you can use Service Registry to catalog MQ Services, govern them as part of the service lifecycle, and perform impact analysis on the registry content.

WebSphere MQ and SOA governance

WebSphere MQ provides a flexible and robust messaging backbone with assured, once-only message delivery. WebSphere MQ (or MQSeries® as it was known in earlier versions) has been deployed for mission-critical financial transactions for more than a decade. Today, many organizations continue to make significant investments in MQ and many have MQ applications implemented throughout their enterprise. However, many of these MQ applications are not well documented or catalogued, and therefore their assets are often not easily available for reuse.

Meanwhile, organizations have looked to service registries and repositories like WebSphere Service Registry and Repository as a tool to enable SOA governance. However, a common requirement from many enterprises is to look beyond using the Service Registry purely as an enterprise tool for governing Web services. Because of the significant investment that they have made in existing non-Web services applications (including WebSphere MQ applications), they are often particularly interested in how they can extend Service Registry to manage these applications as well.

MQ Service Definition specification

The WebSphere MQ Service Definition specification provides a way to describe WebSphere MQ applications as services in the same format as traditional Web services, thus enabling you to manage WebSphere MQ applications as services. The WebSphere MQ Service Definition helps catalog and govern MQ applications by enabling the resources used by an application, such as queues and queue managers, to be easily queried, and for services to be looked up dynamically at runtime. Here is a sample MQ service definition:

Listing 1. Sample MQ service definition
<definitions ...
xmlns:wmqservice="http://www.ibm.com/xmlns/prod/wmq/bindings/1.0" >
<binding ... >
<wmqservice:binding/>
<wmqservice:format>MQSTR</wmqservice:format>
<wmqservice:property>...</wmqservice:property>
<operation ... >
<input>
<wmqservice:body />
</input>
<output>
<wmqservice:body />
</output>
</operation>
</binding>
<port .... >
<wmqservice:address location="wmq:/msg/queue/Qname"/>
<wmqservice:connectQueueManager>Qmgr</wmqservice:connectQueueManager>
<wmqservice:replyTo>msg/queue/QnameReply</wmqservice:replyTo>
</port>
</definitions>

For more information about the MQ Service Definition specification, see the WebSphere MQ Service Definition Specification SupportPac. You can use the MQ Service Definition Wizard in the MQ Explorer in WebSphere MQ V7.0.0.1 to create MQ Service Definitions.

MQ integration feature in Service Registry

The Governance Profile available with WebSphere Service Registry and Repository V6.2.0.2 or later includes the WebSphere MQ Integration Feature. With this feature, the WSDL shredding capability of Service Registry is extended to provide WebSphere MQ WSDL parsing as well. After configuring the MQ Integration feature, when an MQ WSDL document is loaded, Service Registry automatically builds representations of MQ entities such as MQ queue managers, queues, and connections, as well as the relationships between these entities. For more details on the MQ Integration feature, see the WebSphere Service Registry and Repository information center.

Scenario description

These concepts can be illustrated with a scenario based on a fictitious insurance company. This insurance company has a distributed Customer Management and Insurance Premium application that uses WebSphere MQ to send messages from operators to back-end systems. Here is the logical architecture of the scenario:

Figure 1. Logical Architecture
Scenario Logical Architecture

In this scenario, the Call Center and Customer Account Maintenance client applications access information hosted by the Management and Insurance Premium application via queues hosted by two MQ queue managers: INS.PREMIUM.QM and INS.CRM.QM.

  • UpdateCustomer Service -- A message is sent to the UpdateCustomer service to perform an update to customer records based on the content of the message.
  • UpdatePremium Service -- A message is sent to the UpdatePremium service to perform an update to the Insurance Premium based on the content of the message.
  • CalculatePremium Service -- A request message containing a query for the Insurance Premium Quotation is sent to the CalculatePremium service and the quote is sent back in a reply message.

Pre-requisites

The scenario was created with WebSphere MQ V7.0.0.1 and WebSphere Service Registry and Repository V6.2.0.2. This article assumes that:

  1. WebSphere MQ V7.0.0.1 has been installed and the following MQ objects created:
    • MQ Queue Manager 1: INS.PREMIUM.QM
      • MQ Queue Name: CALC.PREMIUM.REQ
      • MQ Queue Name: CALC.PREMIUM.RESP
      • MQ Queue Name: UPDATE.PREMIUM.REQ
    • MQ Queue Manager 2: INS.CRM.QM
      • MQ Queue Name: UPDATE.CUST.REQ
  2. WebSphere Service Registry and Repository V6.2.0.2 has been installed. The governance profile that includes the MQ Integration feature is provided with WebSphere Service Registry and Repository V6.2.0.2 or later.

Creating an MQ service definition in MQ Explorer

This section describes how you will be able to create an MQ Service based on the MQ service definition using the MQ Explorer Service Definition wizard, which is available with WebSphere MQ V7.0.0.1.

Adding a service definition repository

You must create a repository to store a service definition before a service definition can be created:

  1. Launch MQ Explorer.
  2. In the navigator view, right-click on Service Definition Repositories, then click Add Repository to open the Add New Service Definition Repository dialog:
    Figure 2. Add Service Definition repository
    Add Service Definition Repository
  3. Type MQ-WSRR Repository or any other name for the new repository.
  4. Click Finish to close the dialog and create the new repository.

Creating a new service definition

Once you have created a repository in the Navigator view, create the Service Definition for the first MQ service, RequestQuoteService:

  1. Right-click on the repository that you have just created, then click New => New Service Definition to open the New Service Definition wizard.
  2. In the New Service Definition wizard, type RequestQuoteService as the name and select Request-Response as the Message Exchange Pattern, as shown in Figure 3. Click Next:
    Figure 3. Create new service definition
    Create New Service Definition
  3. Select MQ as the Binding Type and click Next.
  4. In the Navigator view, select Operation and type RequestQuote as the Operation name. In the comments field, type Get a Quote for the Insurance Premium:
    Figure 4. Define operation name
    Define operation name
  5. Select Input destination in the navigator. In the Input destination name field, type msg/queue/CALC.PREMIUM.REQ.
  6. In the Destination queue manager name field, type INS.PREMIUM.QM:
    Figure 5. Define input destination
    Define input destination
  7. Select Output destination in the navigator. In the Output destination name field, type msg/queue/CALC.PREMIUM.RESP.
  8. In the Destination queue manager name field, type INS.PREMIUM.QM. Click Finish.

The message schema and the message header properties may be specified in the service definition as well for both input and output messages. The message schema describes the data format of the MQ messages, while the message header properties provides details of message attributes such as Message Id, Correlation Id, Message Persistence, and Codepages. For this scenario, the defaults are taken so no further configuration is required at this stage.

Viewing a service definition WSDL file

To view the contents of the WSDL service definition file:

  1. In the Content view, right-click on the newly created service definition and click View. By default, the WSDL service definition file opens in a new view next to the Navigator view.
  2. The contents of the WSDL service definition should be similar to Listing 2:
Listing 2. Insurance service MQ Service Definition
<xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:tns="http://tempuri.org/RequestQuoteService"  
xmlns:wmqservice="http://www.ibm.com/xmlns/prod/wmq/bindings/1.0" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="RequestQuoteService" 
targetNamespace="http://tempuri.org/RequestQuoteService">
<message name="RequestQuote_Input">
  <part name="RequestQuote_Input_Part" type="xsd:string"/>
</message>
<message name="RequestQuote_Output">
  <part name="RequestQuote_Output_Part" type="xsd:string"/>
</message>
<portType name="RequestQuoteService_PortType">
  <operation name="RequestQuote">
    <input message="tns:RequestQuote_Input"/>
    <output message="tns:RequestQuote_Output"/>
  </operation>
</portType>
<binding name="RequestQuoteService_Wmq_Binding" type="tns:RequestQuoteService_PortType">
  <wmqservice:binding/>
  <operation name="RequestQuote">
    <documentation>Get a Quote for the Insurance Premium</documentation>
    <input>
      <wmqservice:body/>
    </input>
    <output>
      <wmqservice:body/>
    </output>
  </operation>
</binding>
<service name="RequestQuoteService">
 <port binding="tns:RequestQuoteService_Wmq_Binding" name="RequestQuoteService_Wmq_Port">
  <wmqservice:address location="wmq:/msg/queue/CALC.PREMIUM.REQ@INS.PREMIUM.QM"/>
  <wmqservice:replyTo>wmq:/msg/queue/CALC.PREMIUM.RESP@INS.PREMIUM.QM</wmqservice:replyTo>
 </port>
</service>
</definitions>

Creating the remaining service definitions

To create the service definition for the remaining MQ services, repeat the steps in the above section Creating a new Service Definition. Replace the properties defined with these:

  • Update Premium Service

    • Name: UpdatePremiumService
    • Message Exchange Pattern: One-Way
    • Binding Type: MQ
    • Operation name: UpdatePremium
    • Comments: Update Insurance Premium
    • Input destination name: msg/queue/UPDATE.PREMIUM.REQ
    • Destination queue manager name: INS.PREMIUM.QM
  • Update Customer Record Service

    • Name: UpdateCustomerRecordService
    • Message Exchange Pattern: One-Way
    • Binding Type: MQ
    • Operation name: UpdateCustomerRecord
    • Comments: Update Customer Record
    • Input destination name: msg/queue/UPDATE.CUST.REQ
    • Destination queue manager name: INS.CRM.QM

Exporting MQ service definitions

Now that all of the MQ service definitions has been created, they are ready to be exported. To export the contents of the WSDL service definition file:

  1. In the Content view, right-click the service definition repository created earlier and then click Export. A dialog opens to specify the name and location of the exported file.
  2. Ensure that all MQ service definitions created earlier have been selected as shown in Figure 6 below.
  3. Click Browse and select an export destination folder. Click OK:
    Figure 6. Export service definition
    Export service definition

Cataloging MQ service definitions in Service Registry

This section shows you how to store the MQ service definitions that have been created, and manage them as part of Service Registry.

Configuring Service Registry

Before the MQ service definitions are catalogued in Service Registry, you need to enable the governance profile. In Service Registry, the active configuration profile is the one that determines the current Service Registry configuration. To see which profile is active, perform the following actions in the Service Registry Web UI:

  1. Start the WebSphere Service Registry and Repository console (Web UI).
  2. Switch to the Configuration perspective if necessary: select Configuration in the Perspective list and click Go.
  3. Click Manage Configuration Profiles => Configuration Profiles. A list of all the configuration profiles stored in Service Registry is displayed. The entry for the active configuration profile has "Active" in the Status column. By default, the profile WSRR_Default_Profile_V62 has a status of "Active," meaning that it is the active configuration profile.
  4. Select the checkbox besides the WSRR_Governance_Profile_V62 configuration profile and click Make Active:
    Figure 7. Enabling Governance Profile
    Enabling Governance Profile

Loading MQ service definition using the MQ Integration feature in Service Registry

After the WebSphere MQ integration feature has been configured, the MQ WSDL shredding capability is enabled. You will now load the MQ WSDL documents using the standard WSDL document loading mechanism. You can use the service definitions that you have created earlier or you can download service definitions that are provided with this article.

You load the service definitions individually. Proceed to load the service definition for the first MQ service, RequestQuoteService:

  1. Click Service Documents => Load Documents.
  2. Click Browse and select the WSDL document containing the MQ Service Definition, RequestQuoteService.wsdl.
  3. Select WSDL as the document type.
  4. Enter Get a Quote for the Insurance Premium as the document description.
  5. Enter 1.0 as the document version and click OK:
    Figure 8 . Load Service Definition
    Load Service Definition
  6. Click Add Another Document to add the remaining documents to the collection. Repeat steps 2 to 5 with the service definitions for UpdatePremiumService and UpdateCustomerRecordService.
  7. Click Finish after all of the MQ Service Definitions have been loaded, as shown below:
    Figure 9. Load All Service Definition
    Load All Service Definition

Reviewing WebSphere MQ entities in Service Registry

After the MQ WSDL documents have been loaded, Service Registry automatically builds representation of the MQ entities.

  1. From the navigation tree, expand Business Metadata => Technical Service View.
  2. Expand the MQ Entities navigation tree element and click MQ Queue Managers. The collection view shows the MQ queue managers that were used by the MQ service definition that has just been loaded:
    Figure 10. MQ Queue Managers
    MQ Queue Managers

Classifying MQ Queue Managers

Cataloging MQ applications enable a better understanding of previously undocumented MQ applications. It increases the visibility and awareness that organizations have of their MQ applications.

  1. Select MQ Queue Managers => INS.PREMIUM.QM.
  2. Click Edit Classifications.
  3. From the classification tree, expand Governance Profile Taxonomy => Environment. Select the checkbox beside Production and click Add, then click OK:
    Figure 11. Classifying MQ Queue Managers
    MQ Queue Managers
  4. Repeat Steps 1 to 3 to classify INS.CRM.QM. This time, for environment, select Development instead.
  5. Select MQ Queue Managers from the MQ Entities navigation tree again. As it was previously, the list of available MQ queue managers are displayed.
  6. As show in Figure 12 below, now that the filters have identified, there are two categories of MQ Queue Managers, those that are operating in the development environment, and the ones that are in the Production Environment. Click on Environment:
    Figure 12. Categories of MQ Queue Managers
    Categories of MQ Queue Managers
  7. Click on Production. Only the INS.PREMIUM.QM MQ Queue Manager is displayed now.

Classification systems in Service Registry enable organizations to segregate MQ services that are deployed in different environments. By classifying the MQ entities appropriately, you will be able to perform classification-based queries to identify candidate services for reuse. You can also set up Service Registry to restrict access based on classification.

Besides enabling classification systems, user-defined properties can also be used to tag MQ entities as a simple, unstructured, and untyped extension mechanism. Similar to classification systems, properties can be used in queries, and can help establish fine-grained access control.

Generating graphical views for impact analysis

The graphical Impact Analysis feature of Service Registry lets you quickly discover what applications, processes, or services are related to MQ services.

  1. Select MQ Queue Managers from the MQ Entities navigation tree and select the INS.PREMIUM.QM MQ queue manager from the list of MQ queue managers.
  2. From the INS.PREMIUM.QM properties page, click the Impact Analysis tab:
    Figure 13. Specify dependency relationship
    Specify dependency relationship
  3. In the Built-in relationships list, select WSDL service to WSDL port.
  4. In the Custom relationships list select the wsrrtm_requestQueue, wsrrtm_responseQueue, and wsrrtm_queueManager relationships. Click Go. Here is a graphical view of the Impact Analysis result:
    Figure 14. Impact Analysis of Premium Queue Managers
    Impact Analysis of Premium Queue Managers

One possible goal of impact analysis is to determine what will be affected by a change to a particular artifact. Any changes to an MQ queue manager could have an impact on related artifacts. In this case, if INS.PREMIUM.QM is taken offline for maintenance, the RequestQuote and UpdatePremium services will be affected. When changes are made to MQ services, all consumers are notified using one of several options, such as JMS notifications or e-mail. The ability to analyze service dependencies is also useful when considering a service as a candidate for reuse.

Governing life cycle of MQ services

After MQ applications are registered in the Service Registry as services, you can start to govern the life cycle of MQ services. In this section, the RequestQuoteService is initiated into the service lifecycle. By governing the life cycle of MQ services, you can introduce, promote, and retire MQ services while making sure that each transition is validated according to organizational policies:

  1. From the Navigation Tree, expand Business Metadata => Governance Service View => Service Versions.
  2. Select RequestQuoteService and click the Governance tab.
  3. Select InitiateServiceVersionLifeCycle as the initial state transition and click Govern:
    Figure 15. Initiate Service Version LifeCycle
    Initiate Service Version LifeCycle

The RequestQuoteService has now been initiated into the Service Version life cycle. Subsequent transitions in the life cycle can occur after the services are validated according to organization policies leveraging fine-grained, role-based access control and customizable validations. Governing the life cycle of MQ services using Service Registry enables organizations to ensure the quality and reliability of their MQ services for consumption across the organization. This governance helps ensure that the services are properly funded, owned, and deployed. Governing the life cycle of MQ services also enables service consumers to be notified whenever an MQ service is retired, or a version is deprecated.

Conclusion

This article used a scenario to describe how organizations can use WebSphere Service Registry and Repository to catalog existing MQ applications. It also introduced the new Service Definition Wizard in WebSphere MQ V7.0.0.1 and showed you how to use it in a real-life scenario.

Acknowledgement

The author would like to thank Mark Philips for reviewing this article and sharing his expertise.


Download

DescriptionNameSize
MQ Service Definition RepositoryMQ-WSRR-Repository.zip10 KB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=391260
ArticleTitle=Cataloging WebSphere MQ applications with WebSphere Service Registry and Repository
publish-date=05202009