REST curl example not showing payload on Try-Me
I'm following the instructions at https://docs.solace.com/RESTMessagingPrtl/Solace-REST-Example.htm to use curl to publish to a topic:
curl -i \ 'http://<ip>:9000/TOPIC/test' \ -X POST \ -H 'Authorization: Bearer (omitted)' \ -H 'Content-Type: text/plain' \ -H 'User-Agent: SolaceTest' \ -d 'Hello, World'
On the Solace PubSub+ Standard's Try-Me section, I'm seeing the message come in for the topic test
as expected, but the payload of Hello, World
doesn't show. PubSub+ is VMR 9.7.0.40.
Am I doing something wrong? Any advice for how to troubleshoot next?
Best Answers
-
Hi @cverges
I remember seeing this before but not yet really knows what's happened. But I do know that the Try-me inside the Web manager is having that issue, but other code samples or Try-me on the Solace Cloud is fine. I'd suggest you use the other way for now. I'l see if i can find out what it is the cause and update here later.For sample code, you can pick your favorite in github.com/solacesamples and just make sure to modify the topic name to subscribe in the TopicSubscriber code.
For Solace Cloud, you can simply use the Try-me tab there (not inside Web manager or after you click Manage Service). See below for sample.1 -
Not a PEBKAC most definitely my test with SDKPerf also shows slightly different payload raw content for both REST and the pub try-me app.
For now, we can use application/octet-stream in curl such as below until the tutorial gets updated:
0
Answers
-
Hi @cverges
I remember seeing this before but not yet really knows what's happened. But I do know that the Try-me inside the Web manager is having that issue, but other code samples or Try-me on the Solace Cloud is fine. I'd suggest you use the other way for now. I'l see if i can find out what it is the cause and update here later.For sample code, you can pick your favorite in github.com/solacesamples and just make sure to modify the topic name to subscribe in the TopicSubscriber code.
For Solace Cloud, you can simply use the Try-me tab there (not inside Web manager or after you click Manage Service). See below for sample.1 -
Thanks for the fast reply, @arih! If it's just limited to the Try-Me functionality, I'm OK ignoring for now. I just wanted to confirm that the payload is being published properly to a subscriber, and haven't yet finished bringing up my topic subscriber. If you're confirming that this is just due to a Try-Me bug and the REST publishing does, in fact, work, then I'm good to go.
1 -
Yea when sending plain raw text on the REST port theres an issue with showing the body from the Try Me tab, a workaround is if you have access to a solace cloud account you can navigate to the Try Me! widget from your service and under the subscriber you can click on the "show advanced settings" and change the connection to localhost. Alternatively you can also use this public TryMe! widget found here https://solace.com/products/event-broker/software/getting-started/ which is configured to connect to a local broker by default (in your case). Hope this helps!
2 -
@Aaron, I'll trade you? :-)
It's a fairly bare-bones installation for testing purposes. I enabled the REST protocol on the default port (9000) and published to the dynamic topic "test". There is an error
sdtContainer is not defined
that pops up when the REST call is made; it does not show up when publishing via Try-Me. Related in some sense, but not entirely clear what/why at first glance. Nothing in the JS error logs, for example, and the web socket comms are fairly light:Please let me know if you want any other screens/details. I wouldn't be surprised if it's a situational bug (PEBKAC or otherwise).
0 -
Not a PEBKAC most definitely my test with SDKPerf also shows slightly different payload raw content for both REST and the pub try-me app.
For now, we can use application/octet-stream in curl such as below until the tutorial gets updated:
0 -
Having same issue, this message appears when publishing to topic from Mulesoft Anypoint Studio Version: 7.8.0. Using "Try me!" as a producer in the same setup would work fine.
For messages published by Mulesoft, it is either "sdtContainer is not defined" or also "URI malformed" on some.0 -
Hey @FalkLademann I believe you are publishing messages from Mulesoft via a REST API call? What version of the broker are you using? And are you using a software (docker image) or a cloud broker?
0 -
Publish is by JMS. VMR 9.8.0.12 on Docker engine 20.10.2
0 -
@cverges @FalkLademann this has been fixed and delivered in the 9.9 software broker! To be clear, it was only a bug inside the Try Me! little console when displaying messages... the broker was still working fine and everything. Just the little Try Me! subscriber app couldn't show TextMessages.
Anyhow, thanks for letting us know about this..!
1