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?
Comments
-
Hi Sjaak,
Obtaining message payloads via the SEMP v2 API is not possible AFAIK.
See the documentation https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/monitor/index.html#/queue/getMsgVpnQueueMsg
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:
https://docs.solace.com/API-Developer-Online-Ref-Documentation/js/index.html1 -
General tutorials on how to use the Javascript API are found here - I can't locate a queue browser example,
https://github.com/SolaceSamples/solace-samples-javascript1 -
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.
0 -
JMS Toolbox uses JMS API and I assume it's using the QueueBrowser interface
https://docs.solace.com/API-Developer-Online-Ref-Documentation/jms/javax/jms/QueueBrowser.html
This is similar to the JavaScript QueueBrowser I mentioned above.0 -
@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 Thank you.
0 -
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
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: https://docs.solace.com/API-Developer-Online-Ref-Documentation/js/solace.QueueBrowser.html
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.2 -
@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!
0 -
Sounds good! @sjaak We have a Solace Community Github if you were wondering for a place for the source code 🙌
1 -
Ok, community it's on Github now! 🚀
Please take a look at https://github.com/appronto/Solace-browser-extension
We have included a readme with the instructions. Note that this is an experimental Chrome browser extension, so use at your own risk. We would love to see this on https://github.com/SolaceCommunity ( @Tamimi ?) so everybody can contribute and make this extension even better so we can publish it to the Chrome extension store as well for easier installation!
Kudos to our colleague @axeltrip who has built this initial extension during our famous R&D days at Appronto!3 -
Very nice @axeltrip and @PimvdNoll. Thanks for your support.
0 -
That sounds great, @PimvdNoll ! I will get in touch with you for this and see what modifications are needed before we publish to the community page, and we can also add issues to the repo for people to pick up Kudos to you and @axeltrip 🙌
2 -
@Tamimi and @PimvdNoll - Raised a pull request for an issue https://github.com/solacecommunity/solace-queue-browser-extension/pull/3 for the issue https://github.com/solacecommunity/solace-queue-browser-extension/issues/1
0 -
The Chrome extension has received a major update, now offering the following features:
- Support for storing multiple 'Connections,' making it easy to switch between environments.
- AES-GCM encryption for securely storing user passwords for each Connection.
- Import/export functionality for Connections.
Additionally, several quality-of-life improvements have been added. You can check out the update on the Chrome Store or directly from the GitHub repository.
As always please do let us know if you find any unexpected behavior or issues!
3