🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

what is the URL pattern to send a message to Advance Event Mesh through Rest API ?

rajeshy1987113
rajeshy1987113 Member Posts: 6
edited December 11 in PubSub+ Event Broker #1

Event Mesh URL:
POST https://domain/api/v1/queues/myQueue/messages

I tried below pattern but did not work.

POST https://<your-event-mesh-domain>/api/v1/queues/<queue-name>/messages

Tagged:

Best Answer

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin
    #2 Answer ✓

    Hi @rajeshy1987113,

    I just tested using your URL setup + body and it worked for me so that should all be good. I would suggest checking a few things:

    1. Queue names are case sensitive —> make sure they are exactly the same
    2. Make sure your authentication is correct. I used basic auth with a username/password that I got from the "Connect" menu of my service under "REST".
    3. Ensure your Queue has "Incoming" turned on
    4. Ensure your client-username has permissions to "send guaranteed messages" on it's Client Profile.

    If that doesn't work can you share what response you are getting?

    ***Something to consider depending on your user case: while there are use cases when it makes sense to publish directly to a queue, we do generally recommend publishing messages to topics and then have 1 to many queues subscribe to those topics. This allows your publishers and consumers to be more decoupled and more easily take advantage of the publish-subscribe pattern.

Answers

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Hi @rajeshy1987113,

    You're close! The URL structure should look like this https://{host}:{port}/QUEUE/{queue-name} and then your body will go into the payload of the message.

    Hope that helps!

  • rajeshy1987113
    rajeshy1987113 Member Posts: 6

    thanks for responding.

    I tried same but did not work. any pre-request before sending from postman ?

    I have created a queue in my Cluster Manager→ServiceDetails → Manage →Queue —> Queue Name:Sender_Recevier_SBGTest_TestProject.

    I have given credentials which are available under Connect Tab—> REST API.

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin
    #5 Answer ✓

    Hi @rajeshy1987113,

    I just tested using your URL setup + body and it worked for me so that should all be good. I would suggest checking a few things:

    1. Queue names are case sensitive —> make sure they are exactly the same
    2. Make sure your authentication is correct. I used basic auth with a username/password that I got from the "Connect" menu of my service under "REST".
    3. Ensure your Queue has "Incoming" turned on
    4. Ensure your client-username has permissions to "send guaranteed messages" on it's Client Profile.

    If that doesn't work can you share what response you are getting?

    ***Something to consider depending on your user case: while there are use cases when it makes sense to publish directly to a queue, we do generally recommend publishing messages to topics and then have 1 to many queues subscribe to those topics. This allows your publishers and consumers to be more decoupled and more easily take advantage of the publish-subscribe pattern.

  • rajeshy1987113
    rajeshy1987113 Member Posts: 6

    Thanks Marc. Issue resolved , Issue was with permissions on it's Client Profile.

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Excellent, glad to hear it @rajeshy1987113!

This Week's Leaders