Generating a WebSphere MQ export binding with either a one-way operation or request-response operation is shown. Once generated, the binding properties are discussed.
Beneath End-point Configuration, select Specify properties for configuring WebSphere MQ resources (the default) or Specify JNDI name for pre-configured WebSphere MQ resources. If you choose pre-configured, then add the JNDI names for the connection factory and the receive destination for a one-way operation, and receive and send destinations for a request-response operation. Typically, you would choose pre-configured if your system administrator had set up the configuration for you.
For Connection Mode, select between Use host client connection property, where you specify the host name, server channel and port, or Use client channel definition table (CCDT), where these values are specified in the table.
In the Data format section, select how the data will be serialized between the business object and the message. The default data bindings are Unstructured Text Message and Unstructured Binary Message for unstructured text and byte messages, and Serialized as XML and Serialized Java Object for XML and Java objects. In the case of XML, your wrapped data objects must be a complex type; they can not be a simple type.
The alternative is for you to provide your own data binding, in which case select User Supplied. The implementation has to conform to the MQ data binding interface. Click OK. The basic MQ binding is created and shown in the properties view when the Binding tab is selected.
In the Function selector section, select how you will use the function selector. The function selector provides a valuable service at run time. It selects an operation to invoke on a component. In other words, when the message arrives at a destination, the function selector is used to determine which operation corresponds to the message.
Use handleMessage as the native function (default) returns handleMessage as a value. The value is mapped using the export's method bindings to the name of an operation on the interface. The native method is assumed to be handleMessage from the SCA application's perspective. The SCA application does not need to understand the internal representation of the MQ message, but only how it drives the current operation on the interface. It is the recommended selection for most applications. It may be necessary to edit one of the method bindings to bind an operation to the handleMessage native function.
Use messagebody's format as the native function finds the Format field of the last header and returns that field as a String.
Use Type information as the native function creates a method in your export binding by retrieving a URL containing the Msd, Set, Type and Format properties found in the MQRFH2 header. The name of the method will be the interface operation name. This selector can by used to interoperate with messages coming from MQ JMS clients and WebSphere Business Integration Message Broker flows.
Use JMS default function selector means that the JMS function selector is used to create a method in your export binding (see JMS and MQ JMS function selector). The name of the method will be the interface operation name. This function selector reads the native operation from the TargetFunctionName property of the folder of an MQRFH2 header.
User supplied means you create your own function selector by implementing the com.ibm.websphere.sca.mq.selector.MQFunctionSelector class. Implementing your own function selector is discussed in the following section.
You do not see a selection for a messaging domain such as point-to-point or publish-subscribe because the binding generator only supports point-to-point. The MQ JMS binding, however, does support publish-subscribe.
In the Request Message Correlation section, the Asynchronous Reliability property can have these values: assured (default) or bestEffort. Select assured if you want a message to persist through a transaction. In other words, if you want guaranteed delivery of the message. Select bestEffort if you want a high throughput of messages and your application can accept and handle the loss of a message, as persistence is not guaranteed. Event sequence required specifies if the same order of events as received from the WebSphere MQ client must be followed by the component receiving the events.
In the Respond Message Correlation section, theResponse Message ID Options field provides several options. New Message ID lets the queue manager select a unique message ID for the response (default). Copy from Request message ID sets the message ID to be the same as the message ID field in the request. Copy from SCA message sets the message ID to be the same as the one carried in the WebSphere MQ header or create one if not found. As Report Options means that the Report field of the message descriptor (MQMD) is examined to determine how to create the message ID.
The Response Correlation ID Options field provides several options. The Copy from Request Message ID (default) means the response message's correlation ID will be set to the request message's message ID. Copy from Request Correlation ID means the response message's correlation ID will be set to the request message's correlation ID.Copy from SCA message means the response message's correlation ID will be the same value as that found in the WebSphere MQ header or it will be left blank if the value did not exist. As Report Options means that the Report field of the message descriptor (MQMD) is examined to determine how to create the message ID.
If you select Copy from SCA message for either response message ID options or response correlation ID options then you will need to set these fields correctly using a mediation module.
Override reply to queue of request message means you have the option of overriding the ReplyTo.Set message type to MQMT_DATAGRAM or MQMT_REQUEST for request-response operation means you have the option of overriding the MessageType field. The export will, by default, force the ReplyTo and MessageType fields to be appropriate values. Advanced users can switch this off, but you will have to use a mediation module to set the fields to whatever you want. Since you can easily break the export by getting these fields wrong, it is recommended you leave these options checked.