JMS Formats - bytes

Your program can retrieve the payload of a JMS bytes message by mapping the body of the message to an SDO data graph representing the message.

Bytes body

You can retrieve the payload of a JMS bytes message as a Java byte array (byte[]). First, you must retrieve a data graph representing the message from the SIMessage instance. As is common to all data graphs representing JMS messages, the root data object of the graph contains a property named "data", and that data object in turn contains a property named "value". In JMS bytes messages, the value property might be accessed as a Java byte array.

You can access the data within the data graph with code such as this:
SIMessage siMsg;
String format = siMsg.getFormat();
if (format.equals("JMS:bytes")) {
  DataGraph graph = siMsg.getDataGraph();
  byte[] payload = graph.getRootObject().getBytes("data/value");
}
Reference topic    

Terms and conditions for information centers | Feedback

Last updated: April 17, 2014 04:48 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-base-iseries&topic=rjy1131
File name: rjy1131.html