Try PubSub+

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

sjaaksjaak Member Posts: 82 ✭✭✭

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

  • swenhelgeswenhelge Member, Employee Posts: 65 Solace Employee

    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.html

  • swenhelgeswenhelge Member, Employee Posts: 65 Solace Employee

    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-javascript

  • TomFTomF Member, Employee Posts: 269 Solace Employee

    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.

  • sjaaksjaak Member Posts: 82 ✭✭✭

    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.

  • sjaaksjaak Member Posts: 82 ✭✭✭

    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.

  • swenhelgeswenhelge Member, Employee Posts: 65 Solace Employee

    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.

  • sjaaksjaak Member Posts: 82 ✭✭✭

    @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.

  • amackenzieamackenzie Member, Employee Posts: 99 Solace Employee

    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.

  • sjaaksjaak Member Posts: 82 ✭✭✭

    @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:

  • himanshuhimanshu Member, Employee Posts: 45 Solace Employee
    edited February 4 #11

    @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

  • swenhelgeswenhelge Member, Employee Posts: 65 Solace Employee

    @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 ...

  • sjaaksjaak Member Posts: 82 ✭✭✭

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

  • himanshuhimanshu Member, Employee Posts: 45 Solace Employee

    @sjaak said:
    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!

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

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

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

  • PimvdNollPimvdNoll Member Posts: 7

    Kudo's Axel! well done

  • sjaaksjaak Member Posts: 82 ✭✭✭

    Super nice Axel! :smiley: You nailed it

  • himanshuhimanshu Member, Employee Posts: 45 Solace Employee

    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! :)

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

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

  • sjaaksjaak Member Posts: 82 ✭✭✭

    We'll post some more info soon. The core is ready, we now need to make it ready for a release. Stay tuned!

  • TamimiTamimi Member, Administrator, Employee Posts: 218 admin

    Sounds good! @sjaak We have a Solace Community Github if you were wondering for a place for the source code 🙌

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

    Holy crap, that's awesome!! Nicely done!

  • PimvdNollPimvdNoll Member Posts: 7

    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!

  • sjaaksjaak Member Posts: 82 ✭✭✭

    Very nice @axeltrip and @PimvdNoll. Thanks for your support.

  • sjaaksjaak Member Posts: 82 ✭✭✭
    edited March 22 #26

    Community: this is just the core functionality. It would be nice to add must-have features such as "dynamic queue" selection etc. Who is next? :)

  • TamimiTamimi Member, Administrator, Employee Posts: 218 admin

    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 🙌

Sign In or Register to comment.