How to get a message payload using SEMP V2 API (browse queues)

Hi,
We want to build a Chrome extension so we can view a message payload from the Solace Cloud queue management page. As a replacement of JMSToolbox. Question: which SEMP V2 API operation can we use to GET a message payload using a message-id as a parameter?

Hi Sjaak,

Obtaining message payloads via the SEMP v2 API is not possible AFAIK.
See the documentation SEMP API Reference
The “data” element of getMsgVpnQueueMsg doesn’t contain the payload.

Since you are writing this as a chrome extension - I guess you are using JavaScript?
If so you could look at connecting to Solace via the JavaScript API and then use a Queue Browser to obtain messages and dequeue them if required.

Look for QueueBrowser in the API doc - I’ll see if I can find an example:

General tutorials on how to use the Javascript API are found here - I can’t locate a queue browser example,

Hi @sjaak, just to expand on @swenhelge’s answer, we explicitly do not allow admin users access to message data as it is a security violation. Admin users and client users are separately authenticated and authorised.

How does JMSToolbox browse queues? Probably using a JMS based API? We’re trying to find a solution so we don’t need to use JMSToolbox anymore to view payloads.

btw: is the SEMP V2 API operation to GET a message payload on the roadmap? I’m trying to understand what the security concern is. A more fine-grained role-based access queue management console would probably solve this. That is how other platforms implement it.

JMS Toolbox uses JMS API and I assume it’s using the QueueBrowser interface

This is similar to the JavaScript QueueBrowser I mentioned above.

@swenhelge Got it. We’ll have a look at both the JMS API and Javascript API’s. For a Chrome extension, that could work. I’ll check that within our team. Btw: any Javascript queue browser example is helpful :smile: Thank you.

Hi. Interesting project you are engaged in. Hopefully you will be making your Chrome extension freely available and open source so we can all benefit :wink:
As mentioned above, it’s not possible to get message payload from the management interfaces. JMSToolbox does not use SEMPv2 to retrieve messages from queues and durable topic endpoints. It uses a queue browser. It uses SEMPv2 for things you cannot do in JMS like getting a list of queues, DTEs but for the actual messages, it uses JMS Queue Browsing.
So depending on what language you are writing the Chrome extension in, you will want to look into the QueueBrowser class for that language. If it’s JavaScript, look at the API docs. Specifically here: PubSub+ JavaScript API Documentation
JMSToolbox will retrieve the messages in batches (200 at a time by default, I believe) to display in their grid view. For all those messages, they are holding the full message in memory (headers and payload) for quick display of message details when you highlight one of the messages in the grid. So they are not getting the message metadata and then retrieving the payload later, it’s all one step with the QueueBrowser.
There is no “official” sample for the QueueBrowser in JS unfortunately. It’s a fairly straightforward interface, though. Basically it’s a non-destructive consumer.
I hope that helps.

@amackenzie Thank you. Yes, an interesting project. Let’s see how far we get. It’s our number one priority when it comes to Solace and UX. Customers will like it and it will help to sell Solace to new Solace/Boomi customers. UX is important these days! :smile:

@sjaak - We have JMS example in our API archive. Please download the api and you can find the sample code for QueueBrowser here:
sol-jms-10.10.0/samples/src/com/solacesystems/jms/samples/SolJMSQueueBrowser.java

@himanshu - I think we’d ideally be looking for a Javascript example using QueueBrowser. However exploring the JMS code may serve as inspiration to create the Javascript …

For your info. We have an internal hackaton planned for March 10. Topic: Chrome extension for Solace. I’ll keep you posted :smile:

Nice! Looking forward to it!

Awesome! Can’t wait to see what you come up with

We managed to get a chrome extension working to inject the payloads into the Messages Queued tab!
image.gif

Kudo’s Axel! well done

Super nice Axel! :smiley: You nailed it

Very cool, would love to see a write-up/code to see how you did it! Maybe you can present it in the next round of lightening talks as well! :slight_smile:

@axeltrip this is awesome, thanks for sharing. I’d love to see more info as well! Like, how do I use it :slight_smile: