Try PubSub+

Receiving of messages on single queue with multiple consumers

Manikanta532Manikanta532 Member Posts: 7

Hi
we have a project which is using solace queue and has 3 consumers after it was deployed.
If the messages comes on that queue expected order of receiving is
Message1--Q1
Message2--Q2
Message3--Q3

If lets say the Message1 is not acknowleded, how the messages are processed, does the message 2 goes to Q2 or Q1.
we observed behavior of it going to Q1.Is that correct, any insights on this will be helpful.

Answers

  • NehaNeha Member, Employee Posts: 3 Solace Employee

    Hi,
    So what I understand from your question, there is a single Queue and three consumers are bound to it.
    The message delivery behavior will depend on whether the Queue Access Type is exclusive or non-exclusive (Please see this link for the details: https://solace.com/blog/solace-message-queue-access-types/).

    So if the access type is Exclusive, the message will always go to a single consumer. Other consumers will be in Standby mode and will get the message only if the active consumer is not available.
    If the Access type is non-exclusive, messages will be delivered to all consumer in round-robin manner.

    Hope this clarifies your doubt.

    Thanks
    Neha

  • Manikanta532Manikanta532 Member Posts: 7

    Hi Neha,
    Yes, you are right.we are having non-exclusive queues, but still if first message is not acknowledged , still the next coming messages should be received in round robin fashion right ?

  • swenhelgeswenhelge Member, Employee Posts: 21 Solace Employee

    Hi,
    you may find this blog helpful ... https://solace.com/blog/solace-message-queue-access-types/
    If your queue is using "exclusive" access mode messages will not be round robin'd amongst consumers in any case except for the original exclusive consumer disappearing/disconnecting.

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

    @Manikanta532 said:
    Hi Neha,
    Yes, you are right.we are having non-exclusive queues, but still if first message is not acknowledged , still the next coming messages should be received in round robin fashion right ?

    Hi @Manikanta532,
    Yes you are correct. If Consumer 1 is processing Message 1 then other consumers can process messages 2,3, etc. prior to message 1 being acknowledged if you're using a non-exclusive queue.
    -Marc

  • AaronAaron Member, Moderator, Employee Posts: 88 Solace Employee
    edited June 22

    Hey, I talked about this question and answers on my weekly Tuesday office hours. Check it out... (skip to 8m48s)

    https://www.youtube.com/watch?v=d6vHFle74g0&t=528s

Sign In or Register to comment.