MQ data bindings

Data bindings and their relationship to imports, exports, messages and data objects are discussed in this section.

Data bindings handle the transformation of data passed as a Service Data Object (SDO) in a Service Component Architecture-based (SCA) application and the native format in WebSphere MQ. The generate bindings wizard handles this transformation based on some selections you make at generate binding time. Since MQ data bindings differ from the JMS data bindings, this section discusses some of the unique aspects of the MQ data bindings.

MQ message to SCA message architecture

The following points define the MQ message to SCA message architecture:

Accessing MQ messages

To read MQ messages, an MQDataInputStream object is passed. It is based on the DataInputStream class. To write MQ messages, an MQDataOutputStream object is passed. It is based on a DataOutputStream class. These classes contain methods that simplify the reading and writing of types used in MQ message structures. The MQDataInputStream and MQDataOutputStream objects also can determine MQ Coded Character Set Identifier (CCSID) and encoding values. Upon entry to the read() or write() method, the Stream is initialized with the expected CCSID and encoding values. Data bindings for more complex structures may need to update these values during read or write operations. The Streams honor the current CCSID and encoding settings when writing or reading from the MQ message.

The MQDataInputStream and MQDataOutputStream interfaces can be found in WebSphere Integration Developer.

MQ data bindings in WebSphere Integration Developer

In addition to support for the MQ Message Descriptor (MQMD), the MQ data bindings supplied with WebSphere Integration Developer provide complete support for the MQRFH and MQRFH2 headers, which provides interoperability with JMS, WebSphere Message Broker and the publish-subscribe distribution method. Partial support is provided for messages with a format that begins MQH; that is, messages with a format for the form MQHxxxxx. These headers are exposed as binary data in SCA and Service Message Objects (SMOs). SMOs are used in mediation flow components.

Four body data bindings may be used with an MQ import or MQ export. String and binary data bindings treat the body as unstructured binary or text data. XSD types are provided describing the DataObjects used by these bindings. These data bindings require a business object definition matching that expected of the JMSObjectMessage and JMSTextMessage data bindings, as discussed in JMS and MQ JMS data bindings.

Additional bindings store a serialized form of the SCA message body in the MQ message. One serialized form uses Java object serialization and one serialized form uses an XML form. When either of these body data bindings are used with an import, the import includes an MQRFH2 header in the outbound MQ message with a property TargetFunctionName in the folder. This property is set to the name of the invoked operation. An export using the JMS-type function selector will look for a user property with that name.

When a message is parsed, the header bindings are executed first, then the function selector and then the body binding.

Feedback
(C) Copyright IBM Corporation 2005, 2007. All Rights Reserved.