Products | Versions |
---|---|
TIBCO Enterprise Message Service | - |
Not Applicable | - |
Resolution:
Environments
=================
All
Description
=================
The TIBCO Enterprise Message Service server can publish topic messages for internal system events. You can monitor messages processed by a destination as they are sent, received or acknowledged. For example, monitor messages will be sent to "$sys.monitor.Q.r.$TMP$.>" when a message is received by a temporary queue. The property of "message_bytes" in such a monitor message contains the message received by the temporary queue as a byte array. You can use the createFromBytes method (in the various client APIs) to recover the message received by a temporary queue. The following is a sample code snippet.
// receive the monitor message on topic "$sys.monitor.Q.r.$TMP$.>"
javax.jms.MapMessage message = (MapMessage)subscriber.receive();
if (message == null)
break;
// retrieve the byte array from the monitor message
byte[] obj = (byte[])message.getBytes("message_bytes");
// deserialize the message from the byte array
Message core = (Message)Tibjms.createFromBytes(obj);
if (core instanceof TextMessage)
System.err.println("message body: "+ core);