WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Summary of how to create a JMS custom binding

Summary of how to create a Java Message Service (JMS) custom binding using WebSphere Integration Developer.

Introduction

There are predefined Java Message Service (JMS) bindings. The predefined bindings support JMS text messages containing Business Object (BO) XML, and JMS object messages containing serialized Java Business Objects. If a mediation module has to process other JMS messages then you need to create a JMS custom binding. For example, if you want to process JMS map messages or JMS object messages that contain plain, old Java objects (POJO).

Creating a JMS custom 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 JMS custom binding class. If you create a mediation module that requires your JMS custom binding then it must reference your library, and use your JMS class in exports or imports.

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 JMS custom binding class.
  2. Open the properties for the project.
  3. In the navigation tree, click Java Build Path.
  4. Select 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. Select Mediation Module > Next > Next > Select 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 JMS custom binding class

  1. In the JMS custom 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 JMS custom binding with the mediation module

  1. From the mediation module project, right-click on the appropriate export or import.
  2. Select Generate Binding.
  3. Select JMS Binding.
  4. Select either Point-to-Point or Publish-Subscribe.
  5. Select 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 JMS custom binding class.
  7. Fill in the required connection details of the newly created binding.

Deploying a mediation module with JMS custom binding

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

Reference topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\ref\rwesb_summarycreationofjmscustombindings.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)