JMS Formats - text

This topic contains reference information you can use to map from the body of a JMS text message to Service Data Objects (SDO) Version 1.

Text body

You can retrieve the payload of a JMS text message as a Java™ string value (java.lang.String). 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 text messages the value property may be accessed as a Java string value.

Example

You can access the data within the data graph with code like this:
SIMessage siMsg;
String format = siMsg.getFormat();
if (format.equals("JMS:text")) {
  DataGraph graph = siMsg.getDataGraph();
  String payload = graph.getRootObject().getString("data/value");
}



Related reference
JMS formats
Reference topic    

Terms of Use | Feedback

Last updated: Sep 20, 2010 11:08:29 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-nd-mp&topic=rjy1132
File name: rjy1132.html