JMS Formats - text

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

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.

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

指出主題類型的圖示 參照主題



時間戳記圖示 前次更新: July 9, 2016 11:13
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rjy1132
檔名:rjy1132.html