WebSphere Enterprise Service Bus for z/OS, Version 6.2.0 Operating Systems: z/OS


Summary of how to create a custom JMS data binding

How to create a custom Java™ Message Service (JMS) data binding using WebSphere® Integration Developer.

Introduction

Creating a custom JMS data binding involves creating a library and a Java project. The library is to contain a Business Object representing the data to be mapped and the Java project is to contain a custom JMS data binding class. If you create a mediation module that requires your custom JMS data binding then it must reference your library, and use your JMS class in exports or imports.

The following tasks are performed in WebSphere Integration Developer:

Creating a library

  1. Create a library. The library is to contain a Business Object and associated interface.
  2. Within the library, create a Business Object representing the data to be mapped from, or to, the JMS message.
  3. Within the library, create a one-way or two-way interface containing the Business Object.

Creating a Java project

  1. Create a Java project. The Java project is to contain a custom JMS data binding class.
  2. Open the properties for the project.
  3. In the navigation tree, click Java Build Path.
  4. Click Add library > WPS Server Target > Next > Configure wps server classpath > Finish.
  5. Click OK.

Creating a mediation module project

  1. Create a mediation module project. The mediation module project must reference the library you have created.
  2. Click Mediation Module > Next > Next > Click Required Libraries > Finish.
  3. Define the exports and imports required by the mediation module.
  4. Associate the appropriate interfaces with the exports and imports.

Implementing the custom JMS data binding class

  1. In the custom JMS data binding Java project, create a class that implements the com.ibm.websphere.sca.jms.data.JMSDataBinding interface.
  2. Implement the methods of the com.ibm.websphere.sca.jms.data.JMSDataBinding interface.
    • read(Message)
      • Convert an incoming message into a DataObject, and save it in an internal DataObject variable.
      • To create a DataObject, use the following method: DataFactory.INSTANCE.create("http://Namespace","BusinessObjectType"). Where http://Namespace is the namespace of the Business Object, and BusinessObjectType is the name of the complex type of the Business Object. The Business Object can be determined via the mediation export details, which lists the interfaces the export uses. If you open an interface and select the type of the Input or Output, then the type and namespace are shown.
        Note: You must ensure that the name of the complex type of Business Object is the same in your program as in WebSphere Integration Developer. You must also ensure that the namespace used in your program is the same as the namespace displayed by WebSphere Integration Developer.
    • getDataObject()
      • Return the DataObject from the internal variable.
    • setDataObject(DataObject)
      • Store the DataObject in the internal variable, and save the values in internal variables.
    • write(Message)
      • Create the outgoing Message from the values previously set in internal variables.
    • getMessageType()
      • Return the type of supported message from a static variable in com.ibm.websphere.sca.jms.data.JMSDataBinding. For example, JMSDataBinding.MAP_MESSAGE.

Associating the custom JMS data binding with the mediation module

  1. From the mediation module project, right-click on the appropriate export or import.
  2. Click Generate Binding.
  3. Click JMS Binding.
  4. Click either Point-to-Point or Publish-Subscribe.
  5. Click the User-Supplied serialization method. This indicates how data is serialized between a Business Object and a JMS Message.
  6. Specify the fully qualified name of your custom JMS data binding class.
  7. Fill in the required connection details of the newly created data binding.

Deploying a mediation module with custom JMS data binding

  1. Deploy the project, as normal. The custom JMS data binding is included in the EAR file.

reference Reference topic

Terms of use | Feedback


Timestamp icon Last updated: 21 June 2010


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.zseries.doc/ref/rwesb_summarycreationofjmscustombindings.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
This information center is powered by Eclipse technology (http://www.eclipse.org).