[rabbitmq-discuss] Creating exchanges on demand.

Arvind Jayaprakash work at anomalizer.net
Fri Jun 5 20:03:09 BST 2009


On Jun 05, Camilo Lopez wrote:
>Hello list,
>
>I'm pretty new to AMQP and Rabbit. I'm trying to solve a problem where
>I have a queue of incoming jobs and a pool of worker process. Some of
>the jobs have to be processed syncrhonically.
>
>There is one producer process feeding jobs to a incoming queue (q1),
>every job has a unique id encoded in the message. All the workers read
>from q1, do the  processing and put back the result in a outgoing
>queue (q2) using the unique id as routing key.
>
>When a job is synchronous, the producer will subscribe to q2, waiting
>for a result tagged with the unique id  assigned when it was put in
>q1.
>
>Now, in order to wait for a specific message the producer creates a
>new exchange for every synchronous job  with the unique id as key and
>binds it to the queue before subscribing.
>
>Now the question/s:
>
>Is it OK to create a large number of exchanges? is it going to impact
>performance?
> or  Am I doing something terribly wrong here? is there a best
>practice I can refer to? if so any advice on the correct way to do
>this would be appreciated.

Have you looked at this?
http://www.rabbitmq.com/api-guide.html#rpc




More information about the rabbitmq-discuss mailing list