Results 1 to 5 of 5

Thread: One subscriber and multiple consumer Topic Exchange doubt?

  1. #1
    Join Date
    Dec 2010
    Posts
    10

    Default One subscriber and multiple consumer Topic Exchange doubt?

    Started with a topic exchange and i am polling through web gui. Trying to build a web based chat project to start with...I have one subscriber and multiple consumer...but the message is received only by one consumer..

    Couple of questions here
    1)If the same message has to be delivered to n consumers , do i need to create n queues. I mean one queue for each consumer.
    2)Also if the consumer replies back with a message , which queue does that message go to? How do i configure this..

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Regarding #1: Yes. Each Message in a Queue will be delivered to at most one consumer. You can bind multiple Queues to an Exchange and have at least one consumer per-Queue (multiple consumers still make sense, e.g. for load-balancing).

    Regarding #2: The MessageProperties supports a 'replyTo' address.

  3. #3
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    See your other thread for answer to the pub-sub question.

    Did you know that the JSON-RPC plugin actually has a chat application as a demo (see http://dev.rabbitmq.com/www-examples/chat/index.html)?

  4. #4
    Join Date
    Dec 2010
    Posts
    10

    Default

    Quote Originally Posted by Mark Fisher View Post
    Regarding #1: Yes. Each Message in a Queue will be delivered to at most one consumer. You can bind multiple Queues to an Exchange and have at least one consumer per-Queue (multiple consumers still make sense, e.g. for load-balancing).

    Regarding #2: The MessageProperties supports a 'replyTo' address.


    Thanks Mark and Dave,

    Wanted to clarify if this is correct and i am implementing this in a right way.
    If the user logs in and sends a message to a fanout exchange.
    And 10 other users logs in and bind to this this exchange declaring a new queue. We will have 10 queues at that time.

    If at any given time if i have 100 users logged, will end up creating 100 queues. Plus if i want one to one chat, will create a seperate queue for that user.

  5. #5
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    Correct as far as I can tell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •