When trying to print out a message received from monitor topics, it is displayed asMapMessage={ ... Fields={ message_bytes={byte[]:xxx bytes} } }. How to get the actual message from this function?

When trying to print out a message received from monitor topics, it is displayed asMapMessage={ ... Fields={ message_bytes={byte[]:xxx bytes} } }. How to get the actual message from this function?

book

Article ID: KB0090263

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
Since you are using the monitor topics, the message_bytes that you get in this listener is a wire representation of a TibjmsMessage:

Received message: MapMessage={ ... Fields={ message_bytes={byte[]:573 bytes} } }

To reconstruct a message from this you need to use Tibjms.createMessageFromBytes() with the message_bytes byte array. After this conversion, if you print the reconstructed message, it will be the same than the original message received on the destination.

Issue/Introduction

When trying to print out a message received from monitor topics, it is displayed asMapMessage={ ... Fields={ message_bytes={byte[]:xxx bytes} } }. How to get the actual message from this function?