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

How to get the number of current consumers using SEMP V2

sjaak
sjaak Member Posts: 109 ✭✭✭

Hi,
We're trying to find out how to retrieve the current number of queue consumers (TCP sessions) using the SEMP V2 API. The response of "GET SEMP/v2/monitor/msgVpns/{msgVpnName}/queues/{queueName}" does not contain this.

Thank you :smile:

Tagged:

Best Answer

Answers

  • swenhelge
    swenhelge Member, Employee Posts: 80 Solace Employee
    #3 Answer ✓

    Hi @sjaak -
    The number of consumers and details about the conumsers can be obtained via the txFlows sub resource of the Queue API.

    "GET /msgVpns/{msgVpnName}/queues/{queueName}/txFlows"
    (https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/monitor/index.html#/queue/getMsgVpnQueueTxFlows)

    The return value is an array with one entry per consumer flow, i.e. the length of the array is equal to the number of consumers (Queue Transmit Flows are used by clients to consume Guaranteed messages from a Queue).

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 644 admin

    I just quickly looked through the monitor and config sections of the SEMPv2 API, and am surprised that just regular (current) "bind count" doesn't seem to be in there. I don't think you should have to get an array of flow objects to just get the count, especially since it's there in SEMPv1.

  • sjaak
    sjaak Member Posts: 109 ✭✭✭

    Thanks for the updates @swenhelge and @Aaron. We have look!

  • sjaak
    sjaak Member Posts: 109 ✭✭✭

    @Huib Nieuwenhuijsen Check out this thread.

  • sjaak
    sjaak Member Posts: 109 ✭✭✭

    @Aaron The element is called "count" in the TxFlows response. Works :smile:

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 644 admin

    Sure, but I still disagree with having to get all the Tx Flows just to get the count. Perhaps that's just the old-schooler SEMPv1'er in me talking.

  • sjaak
    sjaak Member Posts: 109 ✭✭✭

    I agree. This can be simplified :smile: