What type of JMS message are you sending and how are you setting the payload? Also how are you extracting the payload in the consumer app?
Depending on the type of message you are creating in your JMS app, when received via Solace native Java API the payload maybe encoded in a different part of the message. For a JMS TextMessage
it will be in the XML content part of the message (unless you have the JMS connection factory setting text-msg-xml-payload
to be set to false) and for a JMS BytesMessage
it will be in the Binary part of the message.
To correctly extract the payload when exchanging messages between open APIs and protocols do the following in your message receive callback XMLMessageLister.onReceive()
method:
@Override
public void onReceive(BytesXMLMessage msg) {
String messagePayload = "";
if(msg.hasContent()) {
// XML content part
byte[] contentBytes = new byte[msg.getContentLength()];
msg.readContentBytes(contentBytes);
messagePayload = new String(contentBytes);
} else if(msg.hasAttachment()) {
// Binary attachment part
ByteBuffer buffer = msg.getAttachmentByteBuffer();
messagePayload = new String(buffer.array());
}
// Do something with the messagePayload like
// convert the String back to a JSON object
System.out.println("Message received: " + messagePayload);
}
Also see the following documentation: https://docs.solace.com/Solace-JMS-API/Creating-JMS-Compatible-Msgs.htm if sending from Solace native API to a JMS consumer app.