Generating an MQ export binding

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.

Prerequisite: You should have a module.
In this set of steps, you will learn how to create a WebSphere MQ binding for an export. An MQ binding is used when you want to have your service accessed in an asynchronous manner from the WebSphere MQ Messaging client.
  1. Open the assembly editor. From the component group on the palette, select an export and drag it on to the canvas. An export with no implementation and no interface is created. Right-click the component, select Add > Interface from the pop-up menu and add an interface that describes your interaction with a WebSphere MQ application. Create an export with an MQ JMS binding by right-clicking the component and from the pop-up menu selecting Generate Binding > Messaging Binding >MQ Binding.
    Generating an MQ export binding
  2. The MQ Export Binding dialog box opens.
    Configuration of an MQ binding for a one-way operation
    An interface with only a one-way operation results in the dialog shown above. You must enter an MQ queue manager name, an MQ queue name for the receive destination, host name, server channel name and port to proceed. An interface with a request-response operation produces a similar dialog as shown below with an additional field for a send destination.
    Configuration of an MQ binding for a request-response operation

    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.

    Note: The MQ binding is complete as is and only if you need to change the values do you need to change them in the fields discussed below.
  3. Selecting the Binding tab shows the serialization type, data binding class, function selector type and header information. WebSphere MQ headers have specific data types and parsers for them determine the data type of each field in the header. Support is provided for the MQRFH and MQRFH2 header. You can also create your own header by implementing the com.ibm.websphere.sca.mq.data.MQHeaderDataBinding class.
    General binding properties
    Note: As you proceed through the fields discussed here, remember that extensive hover help is provided on most of the generated fields.
  4. The End-point configuration tab shows the values you entered earlier for queue manager, receive destination and, for a request-response operation, send destination. Also, the client configuration information is specified if you selected Use host client connection property earlier. The coded character set identifier (CCSID) is specified. Selecting Specify JNDI name for pre-configured WebSphere MQ resources removes the fields and lets you enter the JNDI lookup names for the connection factory, receive and send queues. Note that there is a response queue manager, in this particular case. If the destination you are sending the response to is on a different queue manager than the request queue manager, you will need to check your WMQ set up.
    End-point configuration properties
  5. The Message Configuration tab shows the request and response (for a request-response operation) correlation options.

    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.


    Message configuration properties
  6. The Method Bindings tab shows the bound methods. By default, all methods are bound. If you add a method to the interface after you created the binding, however, a Bind operation check box becomes available to add it to the bound methods. If you are using the Use handleMessage as the native function function selector then you need a method binding here with the native method name set to handleMessage. The input and output data serialization types are shown. They are by default the same as the serialization types specified earlier.
    Method level binding properties
  7. Selecting the Security Attributes tab specifies the Secure Sockets Layer (SSL) encryption properties if required. The Cipher Suite field lists the cipher types supported. The Peer Name specifies the SSL peer name used in channel negotiation. Selecting FIPS required checks that the client connection uses a cipher suite supported by the Federal Information Processing Standards (FIPS)-approved Java Secure Sockets extension (JSSE) provider. Reset count specifies the number of bytes transmitted before the SSL encryption key is renegotiated. Certificate Revocation specifies a Lightweight Directory Access Protocol (LDAP) server with a list of SSL certificates which have been revoked; that is, they are no longer valid.
    Security attribute properties
You have created an MQ binding for your export. Compare this approach with creating an MQ import binding.
Related tasks
Generating an MQ import binding

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