Search Discussions

  • Valentin BERNARD at Dec 14, 2011 at 3:05 pm
    Hi,

    I think that would be the "no-local" property of basic.consume, but
    RabbitMQ doesn't support it. I can't really see other ways to emulate
    that behavior easily...

    Cheers,

    Valentin.
    On 14 d?c, 15:18, bill_mar... at freenet.de wrote:
    Hi,



    I am writing an application which allows users to communicate with each other via RabbitMQ.

    Each user-application contains a producer and a receiver to publish or receive messages to/from a direct exchange. Each user can bind to a "chat-room".



    Imagine two users (UserA and UserB). UserA binds to "chatRoom1" and UserB binds to "chatRoom1".

    If UserA publishes a message in "chatRoom1" the consumer of the user-application from UserB and the consumer of the user-application from UserA gets the message.



    I want to prevent that a user gets his own messages to reduce network traffic.

    Is it possible?



    Thanks in advance for your help!



    Kind regards,

    Bill
    ---E-Mail ist da wo du bist!Jetzt mit freenetMail ganz bequem auch unterwegs E-Mails verschicken.
    Am besten gleich informieren unterhttp://mail.freenet.de/mobile-email/index.html



    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
  • Simon MacMullen at Dec 14, 2011 at 5:00 pm
    Here is one approach you could use. Let's stick with the idea that
    you're using routing keys for the chat room name. Furthermore each
    client publishes messages with a "user" header set to the user name.

    So you have some top level exchange (presumably direct or topic) for
    chat room routing. When a new user comes on line, rather than just
    declaring a queue and binding to that exchange, they:

    * Declare a fanout exchange.

    * Declare a headers exchange and bind that to the top level exchange.
    The headers exchange should have its alternate-exchange set to point to
    the fanout exchange.

    * Declare a "junk" queue, with message TTL 0, and bind this to their
    headers exchange with arguments ["user": <their username>].

    * Declare a "message" queue and bind this to the fanout exchange.

    So when they publish a message it goes to the headers exchange. This
    routes it to the junk queue where it expires immediately.

    When someone else publishes a message it goes to the headers exchange.
    This can't route it, which makes it go to the alternate fanout exchange.
    This then routes it to the message queue.

    The key point is the use of alternate-exchange for negation.

    It's a tiny bit fiddly though, so an alternate approach would be to
    write your own exchange type.

    Cheers, Simon
    On 14/12/11 14:18, bill_martin at freenet.de wrote:
    Hi,

    I am writing an application which allows users to communicate with each
    other via RabbitMQ.

    Each user-application contains a producer and a receiver to publish or
    receive messages to/from a direct exchange. Each user can bind to a
    "chat-room".

    Imagine two users (UserA and UserB). UserA binds to "chatRoom1" and
    UserB binds to "chatRoom1".

    If UserA publishes a message in "chatRoom1" the consumer of the
    user-application from UserB and the consumer of the user-application
    from UserA gets the message.

    I want to prevent that a user gets his own messages to reduce network
    traffic.

    Is it possible?

    Thanks in advance for your help!

    Kind regards,

    Bill



    ---
    *E-Mail ist da wo du bist!* Jetzt mit freenetMail ganz bequem auch
    unterwegs E-Mails verschicken.
    Am besten gleich informieren unter
    http://mail.freenet.de/mobile-email/index.html



    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

    --
    Simon MacMullen
    RabbitMQ, VMware
  • Matthias Radestock at Dec 14, 2011 at 5:08 pm

    On 14/12/11 17:00, Simon MacMullen wrote:
    * Declare a "junk" queue, with message TTL 0, and bind this to their
    headers exchange with arguments ["user": <their username>].
    Small improvement: you only need one "junk" queue, rather than one per user.

    Matthias.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedDec 14, '11 at 2:18p
activeDec 14, '11 at 5:08p
posts4
users4
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase