qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Kramer <j...@globalherald.net>
Subject Re: How to properly implement a 1-to-N pattern
Date Wed, 02 Sep 2009 16:17:48 GMT

Hello Acacio,

You can use the Fanout exchange.  Or, you can use a publish-subscribe 
model.  Each server queue that is subscribed to a certain topic on the 
Publish-Subscribe exchange will recieve a message with that topic.  So if 
you have 5 server queues subscribed to the topic "weather", then they will 
all receive messages with the topic "weather".

In turn, you can have any number of local queues listening to the server 
queue.  The local queues are served in a round-robin fashion.  So, if you 
have three local queues listening to one server queue, then only one of 
the local queues will receive any message bound for the server queue.

You can combine this.  Suppose, for example, that you have 15 application 
servers.  You have five different events that you listen for; each event 
has a cluster of three servers used for processing.  To make this work, 
you create 5 server queues and subscribe them each to the appropriate 
topic... then, to each of the 5 server queues set up 3 local queues for 
listening.  In this way, each server queue will distribute requests to its 
own three-server cluster in a round robin manner.

I have a Linux Journal article set to be published in November covering 
these topics.  Let me know if you have more questions.


On Wed, 2 Sep 2009, acacio.centeno@terra.com.br wrote:

> Date: Wed, 2 Sep 2009 14:33:09 +0000
> From: acacio.centeno@terra.com.br
> Reply-To: users@qpid.apache.org, acacio.centeno@terra.com.br
> To: users@qpid.apache.org
> Subject: How to properly implement a 1-to-N pattern
>    *
>    *
>    *
> 	Hi,
> 	                By what I’ve read on the AMQP specification,
> should I have N consumers to a queue, for each message posted to it,
> one of the consumers is going to be activated in round-robin. The
> spec call this a store-and-forward-queue (section 2.1.1). What If I
> want to have all the consumers alerted about each message posted?
> 	                I figured that I could manage to have each of them
> creating a queue and binding it to a fanout Exchange. Then, for each
> message posted to the Exchange, all the queues would get their copies
> and thus all the consumers would be alerted about it.
> 	                So, is this the right way to implement the scenario
> of having a producer activating N consumers or is there another type
> of exchange/queue that would give me this functionality?
> 	Thanks in advance,
> 	Acácio
>   BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }


GlobalHerald.NET, the Smarter Social Network! (tm)

View raw message