[rabbitmq-discuss] Conversation initiation design

Olivier Pernet omp08 at doc.ic.ac.uk
Sat Oct 30 03:42:56 BST 2010

Hi all,

I'm trying to design a conversation initiation scheme for multiple participants.
The participants communicate following a pre-established protocol
which lists roles, and specifies the exchange of messages between

Initiation needs to bind the participants (physical machines) to roles
in the protocol, and give them the name of an exchange they can use to
send messages to other roles in the protocol.
I need one participant to be able to invite others into the
conversation, and offer them to play a given role.

My idea is as follows:

- Have one special exchange, let's name it Init. It's a direct
exchange. It's bound to queues named with the IP address of

- The inviting participant creates Init, then creates a direct
exchange C1 and queues C1R1... C1Rn for each role in the conversation.
It then sends messages like the following to Init:
label: "xxx.xxx.xxx.p1" (ip address of participant 1 to be invited)
contents: "C1,R1" - invitation to play role R1 in conversation C1

- Each participant connects to the queue named for their IP address,
and gets their invitation from it. Some participants might not be
invited and wait here.

- Invited participants all connect to the queue that corresponds to
their invitation (eg. queue C1R1).

- When a participant wants to send a message to whoever plays role Rn,
it sends a message to C1 with label Rn. The message is put in queue
C1Rn, where the participant can pull it.

This will work for many concurrent conversations C1...Cn. There will
always be only one Init exchange.

There's a few unclear points however. Is it possible for a message to
trigger the creation of a queue? For the first step (sending
invitations), if the participants to be invited have not connected yet
and created their IP-address-named queue, the invitations may be lost.
The inviting process could always create the queues for whoever it
wants to invite in advance, I suppose.
I don't really like the first part of my design (the Init exchange and
the IP-address queues). Have you seen similar setups before? Do you
have any advice about how to do this better?

Olivier Pernet

More information about the rabbitmq-discuss mailing list