58 Using IBM WebSphere Message Broker as an ESB with WebSphere Process Server
Figure 4-3 Data bindings
Typically, some pre-supplied data bindings are available. However, if these do not
meet your needs, you can write a custom data binding that conforms to the
commonj.connector.runtime.DataBinding interface. In fact, some data bindings
conform to a more specific interface that extends this one and that provides
methods to get and set transport-specific data.
The DataBinding interface specifies two methods, getDataObject() and
setDataObject(). The first method is used by the WebSphere Process Server to
get the data object that should be used within the module and is typically used
when the data binding is specified on an export. The second method is used to
pass the data object into the data binding to be translated into external data and
is typically used on an import. These roles are swapped when a reply message is
handled in a request-response operation.
4.1.3 MQ binding
IBM WebSphere MQ is a popular middleware set of products that provide a
well-known set of messaging communications between applications, which can
WebSphere Process Server
WebSphere
MQ
Data Binding
SDO
Native
Import
I
WebSphere
MQ
Data Binding
Export
I
SDO
Native
Example: An example of an MQ binding is provided in Chapter 9, “Scenario:
Asynchronous callback” on page 275.
Chapter 4. Connectivity options for interoperability 59
themselves be on many dissimilar systems. An MQ binding provides a way to
communicate directly with WebSphere MQ using both exports (incoming) and
imports (outgoing). An MQ binding communicates with WebSphere MQ using
native MQ messages.
An MQ binding is new for WebSphere Process Server 6.0.2, and is designed to
provide a direct replacement for the WebSphere MQ Link functionality that is still
available as part of the WebSphere Application Server platform. It is more
straightforward to configure and is generally recommended over MQ Link. An MQ
binding also provides a convenient way to communicate with WebSphere
Message Broker via WebSphere MQ.
In the binding settings, receive and send destination names are specified. These
correspond to destinations on a WebSphere MQ queue manager. Such details
as the queue manager name and the host name for the queue manager must
also be specified.
In this section, we show how a WebSphere MQ message maps to SCA artifacts.
That is, we show how a message maps to a business object and how input and
output from a WebSphere MQ client maps to an interface’s operations.
MQ import and data bindings
Four MQ native body data bindings, which serialize between the SDO and the
MQ message body, are supplied with WebSphere Process Server. In addition,
you can use a user-supplied data binding.
Restrictions: An MQ binding has the following restrictions:
? The publish/subscribe method of distributing messages is not currently
supported by the MQ binding, although WebSphere MQ itself supports
publish-subscribe.
? MQ client connections are the only type of connections that are supported.
? Channel compression, which compresses the data that flows on a
WebSphere MQ channel to improve performance, is not supported.
? WebSphere MQ headers have specific data types and parsers for them
determine the data type of each field in the header. MQ bindings currently
provide support for the MQRFH and MQRFH2 header.
60 Using IBM WebSphere Message Broker as an ESB with WebSphere Process Server
Figure 4-4 shows the different data bindings that are provided by WebSphere
Integration Developer for an MQ binding. We explain them in the list that follows.
Figure 4-4 Data binding options for MQ binding
? Unstructured Text Message converts an SDO to and from a string. The SDO
is expected to be a JMSTextBody type of business object.
?
Unstructured Binary Message converts an SDO to and from a string. The
SDO is expected to be a JMSBytesBody type of business object.
?
Serialized as XML serializes SDO to XML or deserializes XML to SDO. The
SDO can be of any type.
?
Serialized Java Object serializes and deserializes an SDO to and from a Java
object. The SDO can be of any type.
The alternative is to provide your own custom data binding, in which case you
can select User Supplied. The implementation must conform to the MQ data
binding interface. That is, you must implement the interface
com.ibm.websphere.sca.mq.data.MQBodyDataBinding, which extends the
interface commonj.connector.runtime.DataBinding.
MQ bindings versus MQ JMS or JMS bindings: Do not be confused by the
use of the JMSTextBody and JMSBytesBody business objects with the
“Unstructured Text Message” and “Unstructured Binary Message” bindings.
The MQ native bindings have no relationship with the MQ JMS or JMS
bindings. These business objects are simply reused for this purpose because
they have the same structure, which is a single string in the case of
JMSTextBody or a single hexBinary in the case of JMSBytesBody.
JMSTextBody and JMSBytesBody have the same message contents as listed
in Table 4-1 on page 55.
Chapter 4. Connectivity options for interoperability 61
WebSphere Process Server provides complete support for the MQMD, MQRFH,
and MQRFH2 headers, providing interoperability with JMS and WebSphere
Message Broker. Partial support is provided for messages with a format that
begins with MQH, for example messages with a format for the form MQHxxxxx.
These headers are exposed as binary data in SCA.
Figure 4-5 illustrates the different MQ native data bindings, the MQ message
structure (generated from the those bindings), and the recommended message
domain (parsers) to be used by WebSphere Message Broker.
Figure 4-5 Relationship of MQ data binding to the message domain
Serialized as XML data binding: The Serialized as XML data binding type
generates an XML message. This data binding is used in Chapter 9,
“Scenario: Asynchronous callback” on page 275.
WebSphere Process Server
WebSphere MQ
Data Binding
SDO
Native
Import
I
WebSphere
Message
Broker
MQ
MQ
Serialized as XML
Unstructured Text Message
Unstructured Binary Message
Serialized Java Object
XMLNS
XMLNS
MRM (XML)
MRM (XML)
MRM (TDS)
MRM(CWF)
BLOB
MQ Native Data Binding MQ Message (Header + Body) Message Domain
XML MessageMQRFH2MQMD
Java ObjectMQRFH2MQMD
Unstructured Text MessageMQRFH2MQMD
Unstructured Binary MessageMQRFH2MQMD
62 Using IBM WebSphere Message Broker as an ESB with WebSphere Process Server
Example
Using the Unstructured Text Message data binding stores the SDO as a string in
the MQ message body, which can be parsed by the MRM parser in WebSphere
Message Broker using TDS as the physical format. To accomplish this scenario:
1. To use Unstructured Text Message as the data binding, the SDO must be of
JMSTextBody type. Include this type in an SCA module using WebSphere
Integration Developer:
a. Right-click the business integration module and select Open
Dependencies.
b. In the window that opens (Figure 4-6), under Predefined Resources,
select Schema for simple JMS Data Bindings.
Figure 4-6 Adding a schema for JMS data bindings to the workspace
c. Save your work and close the dependencies editor.
d. In the navigation area, expand Data Types. The new business objects,
including JMSTextBody, are displayed (Figure 4-7).
Figure 4-7 JMS data types
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.188.160