<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Aug 22, 2008 at 3:05 PM, Ben Hood <span dir="ltr">&lt;<a href="mailto:0x6e6562@gmail.com">0x6e6562@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Torben,<br>
<div class="Ih2E3d"><br>
On Fri, Aug 22, 2008 at 1:57 PM, Torben Hoffmann<br>
&lt;<a href="mailto:torben.lehoff@googlemail.com">torben.lehoff@googlemail.com</a>&gt; wrote:<br>
<br>
&gt; Here is the basic problem I need to solve - see attached picture:<br>
&gt; A, B and C are all members of the same group G and when they send messages<br>
&gt; to each other in the group the group ID is used as the target address in the<br>
&gt; message.<br>
&gt;<br>
&gt; (In case the attached picture does not arrive: A is located at machine M1, B<br>
&gt; @ M2 and C @ M3.)<br>
&gt;<br>
&gt; So when A sends Msg to the group G it has to be routed to B and C where ever<br>
&gt; they may be. As you can see A sends Msg to M1 which notices that it is<br>
&gt; targeted to the group G and M1 then finds out that there are group members<br>
&gt; of G at the machines M2 and M3, hence it sends Msg to M2 and M3. At the<br>
&gt; receiving machines - M2 and M3 - the message is then delivered to the<br>
&gt; members of the group attached to the machine.<br>
<br>
<br>
</div>This *sounds* like a simple fanout exchange scenario. Fanout exchanges<br>
are one of the basic exchange types in AMQP. It could also be achieved<br>
using other exchange types, depending on what the specific<br>
requirements are.<br>
<div class="Ih2E3d"><br>
&gt;<br>
&gt; The na�ve approach would be to create a queue for the group G and have all<br>
&gt; group members subscribe to that queue.<br>
&gt; Questions:<br>
&gt;<br>
&gt; &nbsp; &nbsp;1. Does the sender receives its own message though the queue?<br>
<br>
</div>Not quite sure what you mean with this. Are you asking whether a<br>
producer gets an echo of each message it sends by default? In general<br>
nobody will receive a message unless it is consuming from a queue that<br>
messages are routed to.</blockquote><div><br>Alexis added the last bit of explanation so now I know that I can send to a queue where I am a consumer without getting my own messages.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">
&gt; &nbsp; &nbsp;2. Is there a way to notify clients like B and C that there is a message<br>
&gt; for them in one of their queues? Or do you have to poll the queue to find<br>
&gt; out if there is something for you? (Basically this is a question of using a<br>
&gt; interrupt like thing vs polling.)<br>
<br>
</div><br>If a client subscribes to a queue, the channel will deliver messages<br>
to it as and when they are routed, so there is no need to poll<br>
explicitly. If for some reason you need to poll, there is a method<br>
called basic.get which allows you to poll a queue.</blockquote><div><br>This is brilliant - for sanity I would really like to avoid polling the queue since the non-polling setup makes my architecture a lot nicer.<br>&nbsp;</div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
BTW, are you asking this question in the context of the API of a MOM<br>
system that you have used in the past?</blockquote><div><br>Not sure what a MOM system is, but I am trying to map the functionality of a legacy system to AMQP since I think it could save a lot of effort and money.<br>&nbsp;<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
&gt;<br>
&gt; Now for the deployment: I cannot use a single AMQP server to handle all of<br>
&gt; this since the load would be too high to meet the strict performance<br>
&gt; requirements in place so some sort of distribution of the work must be done.<br>
&gt;<br>
&gt; My initial understanding leads me to say that for the attached problem I<br>
&gt; should create a cluster consisting of M1, M2 and M3 and then just let<br>
&gt; RabbitMQ deal with all the nitty gritty details.<br>
<br>
</div><br><br>You can set up a cluster of Rabbit broker instances. This is explained<br>
in more detail in the clustering guide:<br>
<a href="http://www.rabbitmq.com/clustering.html" target="_blank">http://www.rabbitmq.com/clustering.html</a><br>
<div class="Ih2E3d"><br>
&gt; Is that a correct understanding of how to use RabbitMQ to address the basic<br>
&gt; problem?<br>
<br>
</div>Without wanting to assume anything from the attachment, the impression<br>
arises that you are thinking of an MQ-Series topology with<br>
transmission queues.<br>
<br>
You don&#39;t necessarily need to do that with AMQP. You could treat a<br>
broker or cluster of brokers as a single logical instance that clients<br>
connect to in order to subscribe to queues.</blockquote><div><br>For my basic problem I would like to have a queue for the group G that I can send to and then all members of the queue (bar the sender) will receive that message.<br>
It does not matter if I have one or more logical instances, but from a architectural perspective I think that it would be best to have a single logical instance so that I could utilise the distribution mechanisms of RabbitMQ without knowing about the topology at the application level.<br>
<br>If I have more than one server how would the messages be distributed? <br>If I have a AMQP server at each of my machines and user A sends a message to the group G how would that message be routed to&nbsp; B and C? How should the servers be connected/configured to allow that routing?<br>
<br>Note that I could have hundreds of machines but I will send the message to the few of them that has a member of the group registered at the machine.<br><br>Cheers,<br>Torben<br></div></div><br></div>