Web Service Enabling MQSeries
Over the last 10 years many service-oriented systems have been created using MQSeries. In most cases, the client applications create messages according to a pre-defined format (such as fixed record format, name/value pairs, delimited format, etc.), puts them on the appropriate message queue, and receives correlated responses on a response queue.
Artix Encompass provides comprehensive and easy to use tools, APIs, and run time services for non-invasively exposing these MQSeries services as Web services. Using Artix Encompass, new Web service clients can send SOAP messages over HTTP/S or MQSeries, and Artix Encompass will map these to the message format which the MQSeries service is expecting. Artix handles any response messages in a similar fashion. Furthermore, Artix Encompass can be configured to do this in a declarative fashion with no coding.
Development Time
To expose an existing MQSeries service as a Web service, the developer uses the Artix Designer to create a service contract for the existing MQSeries service based on the legacy message format. For example:
- Fixed format - enter the names of the fields, their fixed lengths, and their structure including nested structures. This works well for many types of COBOL Copybooks.
- Delimited format - enter the names of the fields, the delimiters between fields and records (such as comma, space, newlines, etc).
- Name/Value pairs - similar to delimited except pairs of fields are handled as name/value pairs.
- WSDL or XML - import WSDL definitions or XML schema that define the message format.
Based on this information, the Artix Designer creates a WSDL service contract that contains:
- A logical contract for the MQSeries service, which is independent of the underlying message formats and transports.
- A binding for the legacy message format and the MQSeries transport, which is used when communicating with the existing MQSeries service.
- A SOAP/HTTP(S) binding that is used for handling incoming Web service invocations for the existing MQSeries service.
This WSDL service contract can now be given to the developers building the Web service consumer. For example can be imported into Visual Studio if the Web service consumer is a .NET client. It can be used with the Apache AXIS toolkit if the Web service consumer is a Java client. It can be used with the Artix Designer if the Web service consumer is a C++ client (see C++ Web Service Clients).
As long as the Web service consumer adheres to the logical contract defined in WSDL, Artix Encompass will be able to map the incoming SOAP messages to the legacy message format.
Deployment Time
At deployment time, the WSDL service contracts are augmented with configuration data that the Artix Encompass run time uses to
- connect to the appropriate queue managers and queues
- route messages from these queues to the appropriate MQSeries services
- identify header fields and message fields that should be consulted to determine the type of the operation
- list the name of the reply queue used for reply messages (this can be done dynamically at run time too)
- define the message correlation technique used when interacting with the MQSeries services messages (this can be done dynamically at run time too).
Once again this information is defined in a declarative manner using the Artix Designer and does not involve any coding.
Run Time
At run time, the Artix Encompass run time receives incoming SOAP messages (over any supported transport but most likely HTTP/S or MQSeries), converts them to the appropriate legacy message formats, and dispatches them to the MQSeries services.
- The incoming message is automatically mapped to the destination message based on the shared logical contract. For performance reasons, mapping is done directly without converting data to a canonical format
- Artix routes the incoming message to the appropriate MQSeries service (see Message Discrimination)
- It waits for a correlated response from the MQSeries service (see Message Correlation)
- It map the response message into a SOAP response and reply to the original sender.
Artix Encompass can automatically bridge between One-Way operations and Request/Reply operations in such a manner that the Web service client is not aware of any differences.
|
MQSeries One Way Operation |
MQSeries Request / Response Operation |
|
|---|---|---|
|
Web services One Way Operation |
Supported SOAP message converted to legacy format and dispatched to MQSeries service no response sent to Web service client. | Supported SOAP message converted to legacy format and dispatched to MQSeries service; response message is discarded. |
|
Web services Request/Reply Operation |
Supported SOAP message converted to legacy format and dispatched to MQSeries service. Artix Encompass responds with reply message if the MQSeries message is successfully queued; otherwise it responds with SOAP Fault if error occurs. |
Supported SOAP message converted to legacy format and dispatched to MQSeries service, Artix Encompass waits for correlated response, converts to SOAP message and returns to client. Responds with SOAP Fault if error occurs. |
Support for Advanced Features
Artix Encompass supports several forms of Message Discrimination when handling MQSeries messages All three approaches are defined in a declarative manner using the Artix Designer and do not require coding:
- Queue Based---Sometimes message type can be determined by what queue the message arrives on. Sometimes this will be a temporary queue defined based upon a model queue
- Header Based---Sometimes message type can be determined by information in the MQSeries message header (for example, Application Identity Data).
- Body Based---Sometimes message type can only be determined by an application defined field somewhere in the message body
Artix Encompass supports several Message Correlation techniques, since message correlation is an application protocol and MQSeries does not prescribe a single standard mechanism. For example:
- Request Message Id correlated with Reply Message Id
- Request Message Id correlated with Reply Correlation Id
- Request Correlation Id correlated with Reply Correlation Id
Artix Encompass supports MQSeries Transaction Handling. All three approaches are defined in a declarative manner using the Artix Designer and do not require coding:
- Artix Encompass can be configured to dequeue MQSeries messages under an internal syncpoint, meaning messages will be returned to the queue if the commit is not called
- Artix Encompass can be configured to dequeue MQSeries messages under XA transaction manager coordination (MQSeries is a resource manager)
- Artix Encompass can be configured to dequeue MQSeries messages under an XA transaction with MQSeries as the transaction manager, and other resources can be coordinated in the same transaction (MQSeries is a transaction manager)
Artix Encompass supports MQSeries Backout Count and Exception Processing. All approaches are defined in a declarative manner using the Artix Designer and do not require coding:
- When a transaction is aborted, the backout count is automatically incremented on the MQ message header
- Thresholds can be set on the backout count, and when the threshold is triggered Artix Encompass can be configured to automatically process bad messages. For example, it can send bad messages to another queue or write them to a log or generate an SNMP trap.
- When errors occur getting a message from a queue and sending it to a SOAP/HTTP Web services destination, SOAP faults and HTTP communication errors will automatically abort the transaction.
Artix Encompass supports Report-On-Arrival, Report-On-Delivery, and other MQSeries report messages.
IN DEVELOPER CENTER...
Related Content
Need More Info?
Feel free to reach us by phone or email anytime of the day.
> View Phone Numbers
> Contact Us Form