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
- Create a library. The library is to contain a Business Object and associated
interface.
- Within the library, create a Business Object representing the data to
be mapped from, or to, the JMS message.
- Within the library, create a one-way or two-way interface containing the
Business Object.
Creating a Java project
- Create a Java project. The Java project is to contain a custom JMS
data binding class.
- Open the properties for the project.
- In the navigation tree, click Java Build Path.
- Click .
- Click OK.
Creating a mediation module project
- Create a mediation module project. The mediation module project must reference
the library you have created.
- Click .
- Define the exports and imports required by the mediation module.
- Associate the appropriate interfaces with the exports and imports.
Implementing the custom JMS data binding class
- In the custom JMS data binding Java project, create a class that implements
the com.ibm.websphere.sca.jms.data.JMSDataBinding interface.
- Implement the methods of the com.ibm.websphere.sca.jms.data.JMSDataBinding
interface.
- read(Message)
- 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
- From the mediation module project, right-click on the appropriate export
or import.
- Click Generate Binding.
- Click JMS Binding.
- Click either Point-to-Point or Publish-Subscribe.
- Click the User-Supplied serialization
method. This indicates how data is serialized between a Business Object and
a JMS Message.
- Specify the fully qualified name of your custom JMS data binding class.
- Fill in the required connection details of the newly created data binding.
Deploying a mediation module with custom JMS data binding
- Deploy the project, as normal. The custom JMS data binding is included
in the EAR file.