Generating a JMS export binding

Generating a JMS export binding with either a one-way operation or request-response operation is shown. Once generated, the binding properties are discussed.

Prerequisites: You should have a module.

If you intend to use the standard JMS message class with a body type containing the message then you must create business objects for these body types. A function is provided that will create the entire set of business objects for the JMS body types. In your module, open the dependencies editor. Under Predefined Resources, select Schema for simple JMS Data Bindings. Save your work and close the dependencies editor. In the navigation view under Data Types, the business objects are created.

Afterwards, create an interface for your export that contains the appropriate data types for input and output. For example, if you were using the TextMessage body, create an interface with an operation such as handleText with an input type of JMSTextBody and an output type of JMSTextBody. These data types will be selectable from the types in the interface editor.

In this set of steps, you will learn how to create a JMS binding for an export. A JMS binding is used when you want to have your service accessed in an asynchronous manner from the WebSphere Default 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 JMS application. Create an export with a JMS binding by right-clicking the component and from the pop-up menu selecting Generate Binding > Messaging Binding > JMS Binding.


    Creating an export with a JMS binding

  2. The Configure JMS Export Service dialog box opens. An interface with a one-way operation results in the dialog shown below.


    JMS export binding configuration for an interface with a one-way operation

    An interface with a request-response operation produces a similar dialog as shown below with an additional field for a send destination.


    JMS export binding configuration for an interface with a request-response operation

    Select the messaging domain: Point-to-Point or Publish-Subscribe. Publish-subscribe is selectable if the interface only has one-way operations.

    Select if you wish to Configure new messaging provider resources (the default) or Use pre-configured messaging provider resources. If you choose pre-configured, then add the JNDI names for the activation specification and the receive destination for a one-way operation, and receive and send destinations for a request-response operation.

    In the Security configuration section, enter the J2EE Connector (J2C) authentication data entries, if used by your organization.

    In the Data format section, select how the data will be serialized between the business object and the JMS message. For data bindings beginning Simple JMS, you must have previously created the business objects required (see the Prerequisites section). The default data bindings are:

    • Serialized Business Object using JMS ObjectMessage sends the business object whose underlying implementation is a service data object (SDO) in a JMS object message to and from the JMS client. This serialization type is preferred when dealing with other SOA components using JMS.
    • Business Object XML Using JMS TextMessage serializes the business object to and from XML and uses a JMS text message to communicate with the JMS client. To see how the business object is serialized to XML, see Business object XML using JMS text message serialization. Your wrapped data objects must be a complex type; they can not be a simple type.
    • Simple JMS TextMessage Data Binding sends the JMSTextBody business object in a TextMessage message body to the client. The message body type is a String.
    • Simple JMS BytesMessage Data Binding sends the JMSBytesBody business object in a BytesMessage message body to the client. The message body type is a byte array.
    • Simple JMS MapMessage Data Binding sends the JMSMapBody business object in a MapMessage message body to the client. The message body type is a set of name/value pairs that can be addressed by name. The data type of the value is a Java primitive.
    • Simple JMS StreamMessage Data Binding sends the JMSStreamBody business object in a StreamMessage message body to the client. The message body type is a stream of Java primitives.
    • Simple JMS ObjectMessage Data Binding sends the JMSObjectBody business object in an ObjectMessage message body to the client. The message body type is a serialized Java Object.
    • Simple JMS Message Data Binding does not have a message body. It can be used to notify the JMS client of an event or to send some simple data in the message headers or properties.

    The alternative is for you to provide your own data binding for the serialization, in which case select User Supplied. The implementation has to conform to the JMS data binding interface.

    The FunctionSelector class provides a valuable service at run time. It selects an operation to invoke on the component. In the Function selector section, if you do not wish to use the default JMS function selector class, deselect it. After deselecting the default JMS FunctionSelector, you should browse and select the FunctionSelector you do wish to use.

    If you intend to use the standard JMS message class with a body type containing the message then you must use a specific function selector, which uses the JMSType message property to determine its operation name. For example, if you had selected for your serialization type, Simple JMS TextMessage Data Binding, then you would use this particular function selector. Deselect the Use the default JMS Function Selector class check box. Click Browse and select JMSFunctionSelector from the Select Type dialog box. The qualified class name is com.ibm.websphere.jms.data.bindings.JMSFunctionSelector.

    Click OK. The basic JMS binding is created and shown in the properties view when the Binding tab is selected.

    Note: The JMS 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. Some of the values will need to match those specified on the server such as the resource adapter name and bus name. If you have runtime documentation, these properties will be specified there as well. A link is provided in the next paragraph to the runtime documentation.

    The following sections describe the major binding properties. After generating a JMS binding with the wizard, you can use hover help to get descriptions of all the properties. These properties are also fully described in the administration reference of the WebSphere Process Server.

  3. Selecting the Binding tab shows the adapter type, function selector class name and serialization type.


    Export binding general information

  4. Selecting the End-point configuration tab and the Connection tab, opens the connection properties. You may specify a JNDI lookup name. If a JNDI lookup name is specified, the activation specification class and its properties will be hidden. In addition, all sections except method bindings properties and authentication properties on the Security attributes tab will be hidden. In our case, a JNDI lookup name was not specified. The Activation Spec Properties section specifies the properties for the activationspec class, which represents the configuration required to establish the connection between the service and the messaging provider. Specifically, these properties specify the bus name, durability, destination type and mode, and advanced properties for concurrency and sharing of durable subscriptions. Show Advanced specifies the listener type.


    Endpoint connection configuration properties

  5. Beneath JMS Destinations in the Receive Destination Properties section, the type of destination and its properties are listed and can be changed. If you specify a JNDI name, this information is not available as it is configured on the server. Note: If you specify nothing in the Queue Name or Topic Space field, a default value will be created. If you specify a queue name or a topic space, this value will remain even if you then clear the field. The only way to change the value is to specify a different value.


    Receive destination properties

    Selecting the Send Destination Properties section, specifies the type of destination and its properties. If you specify a JNDI name, this information is not available as it is configured on the server; that is, the destination specified on the server under this JNDI name will be used. Note: If you specify nothing in the queue name or topic space field, a default value will be created. If you specify a queue name or a topic space, this value will remain even if you then clear the field. The only way to change the value is to specify a different value.


    Send destination properties

    In the Callback Destination Properties section, the callback destination type may be specified or a JNDI name where the same information is specified.


    Callback destination properties

  6. Selecting the Response Connection tab lists the managed connection factory properties and the administration connection properties of the response connection. The Managed Connection Factory Properties section specifies the managed connection factory class and its properties such as the service bus name and quality of service with respect to persistence, in the case of the WebSphere default messaging provider resource adapter. Other JMS resource adapters would have different properties. The necessary fields are completed for you. Show Advanced indicates if this is a shared connection property.


    Managed connection factory properties

    Expanding Admin Connection Properties provides connection pool properties and configuration properties if you would like custom names and values. If you had specified an JNDI name earlier, it is empty since the server is determining connection pooling values and only an information name is present.


    Administration connection properties

  7. Selecting Method bindings lists the methods and lets you specify serialization types for each input and output data binding in each method. By default, all methods are bound. However, some of these methods may not be needed for JMS usage. If so, deselect the Bind operation check box. The method binding has a native method attribute, which contains an identifier representing a JMS message. By default, the value of native method is set to the interface operation name when the JMS export is created. The JMS export utilizes a function selector to inspect an incoming message and return the name of the native method from a value in the message header.


    Method level bindings

  8. Selecting the Security attributes tab and the Connection tab and expanding the Authentication Properties section opens the authentication properties for a connection. The J2C Authentication Data Entry property is available if you want to specify a name. If Show Advanced is selected, authentication properties are opened such as the level of the authentication; for example, at the container level.


    Authentication properties

    Selecting Response Connection and expanding the Authentication Properties section opens the authentication properties for the response connection. The J2C Authentication Data Entry property is available if you want to specify a name. If Show Advanced is selected, authentication properties are opened such as the level of the authentication; for example, at the container level.


    Authentication properties for a response connection

  9. Selecting the Message Configuration tab shows performance-related properties. 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.


    Performance properties

  10. Selecting the Summary tab specifies the send and receive (in the case of a request-response operation) JNDI names for destinations and the request and response connection factories. The listener port name, function selector class name and data binding class name are also specified. The JNDI names are generated by the SCA JMS handler or defined by yourself when the application is deployed. These JNDI names may be necessary when authoring the targeted JMS application.


    Binding properties summary

You have created a JMS binding for your export. Compare this approach with creating a JMS import binding.

You can customize JMS bindings in the runtime environment. This customization translates your own custom object streams to data objects. See JMS data binding samples for WebSphere Process Server V 6.0.2 for an example of this customization.

Related tasks
Generating a JMS import binding

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