Exchanging a formatted record with a non-JMS application
Follow the steps suggested in this task to design and build a data conversion exit, and a JMS client application that can exchange messages with a non-JMS application using JMSBytesMessage. The exchange of a formatted message with a non-JMS application can take place with or without calling a data conversion exit.
Before you begin
About this task
A JMS client is easier to write if it is not involved in the details of formatting JMS messages exchanged with other JMS clients. As long as the message type is JMSTextMessage, JMSMapMessage, JMSStreamMessage, or JMSObjectMessage, WebSphere MQ looks after the details of formatting the message. WebSphere MQ deals with differences in code pages and numeric encoding on different platforms.
You can use these message types to exchange messages with non-JMS applications. To do so, you must understand how these messages are constructed by WebSphere MQ classes for JMS. You might be able to modify the non-JMS application to interpret the messages; see Mapping JMS messages onto WebSphere MQ messages.
An advantage of using one of these message types is the JMS client programming does not depend on the type of application that it is exchanging messages with. A disadvantage is that it might require a modification to another program, and you might not be able to change the other program.
An alternative approach is to write a JMS client application that can deal with existing message formats. Often existing messages are fixed format and contain a mixture of unformatted data, text, and numbers. Use the steps in this task, and the example JMS client in Writing classes to encapsulate a record layout in a JMSBytesMessage, as a starting point for building a JMS client that can exchange formatted records with non-JMS applications.