Try PubSub+
If you haven't already, check out our new Developer Portal! You'll find useful information about Solace PubSub+ as well as handy resources to get you started.

NOt able to see message content on Try-Me on Solace on docker

harryharry Member Posts: 10
edited May 3 in PubSub+ Event Portal

I have solace running on docker and have used JMS API to send message to a queue (the topic named "dt' is subscribed to queue named "que1'). The event is received through the code as
2020-05-03 20:34:30:300 [Topic dt]
Delivery Mode:
Persistent
Sender Timestamp:
2020-05-03 20:34:12:510
Priority:
4

But the conntent of message is not visible. When i send the message through java script running in Try-Me publisher the message is shown .ANy help?

Comments

  • AaronAaron Member, Moderator, Employee Posts: 62 Solace Employee

    Hey @harry. Are you sending a text message? I would check your JMS connection factory. It's most likely configured to use the "XML Portion" of the payload:

    6650bdcff498> show jndi connection-factory * detail
    
    Connection Factory : /jms/cf/default
    Message VPN : default
      messaging-properties : 6
        default-delivery-mode        : persistent
        text-msg-xml-payload         : true                          <-------
    

    This is due to some old-school legacy configuration. (there are actually 2 separate payload sections in Solace messages, FYI). Anyhow, the "Try Me!" mini app only shows data from the binary portion of the payload. Solace is aware of this and is planning to fix soon.

    So, either change your connection factory to set "text-msg-xml-payload" to false OR try sending a Bytes/binary message instead with your UTF-8 String as payload. I'd recommend the 2nd option, as then you can easily interoperate with non-Solace APIs and protocols, like MQTT.

  • harryharry Member Posts: 10

    Hi @Aaron , yes i was sending a text message.
    I changed that too
    BytesMessage message
    message=session.createBytesMessage();//(res);
    message.writeUTF(res); ``
    messageProducer.send(topic,message);

    and it worked like a charm. Thanks for the help. But if i send a text message to an actual solace queue in production (basically publishing to topics binded to a queue) , then the broker will publish the data to consumers through REST API, ) that should not be an issue right?

  • AaronAaron Member, Moderator, Employee Posts: 62 Solace Employee

    Ah, interesting. You are configuring a queue and an RDP to "webhook" the messages out to a REST endpoint? Either way, no I don't think it should be a problem. In fact, I think it should be less of a problem than having it configured the previous way.

    Always best to test. I don't know 100.000% off the top of my head. ;-)

    But hey, you could also implement my 1st suggestion where you just change the JMS connection factory to say "false" for text-msg-xml-payload and both should work the same... the Try Me! mini app should see it... and the outbound RDP REST API should convert it just the same.

  • marcmarc Member, Administrator, Moderator, Employee Posts: 85 admin

    @harry, on top of the tips that @Aaron provided you I would like to say that we have also opened a bug against the try-me tab to to show the payload when text-msg-xml-payload is set to true.

  • harryharry Member Posts: 10

    Sure @Aaron , and thanks @marc , i am just getting started with solace, lots of things to learn and understand and hopefully you are gonna hear more from me, cheers.

Sign In or Register to comment.