qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Godfrey <rob.j.godf...@gmail.com>
Subject Re: best way to chain queues?
Date Thu, 01 Oct 2009 15:33:33 GMT
If you're using the Java Broker then there's really no appreciable
difference in speed between using many fanout exchanges and a single direct
exchange (basically the only difference is the cost of a single in memory
lookup in a HashMap)...

For fanout you're basically doing:

get-fanout-exchange(name) [1 map lookup]; get-queues [return list of queues
bound to the exchange]; for each queue enqueue message on queue

For direct you're doing

get-direct-exchange(name) [1 map lookup]; get-queues(routing-key) [1 map
lookup]; for each queue enqueue message on queue

Given the issues you've seen using fanout, and the fact that the direct
exchange is in much more common usage (the Java client JMS implementation
never uses fanout but does use the direct exchange)... I'd strongly suggest
going down the direct exchange route.

Hope this helps,

2009/10/1 mARK bLOORE <mbloore@gmail.com>

> I am processing data through several scripts, passing it between them
> via AMQP.  Each script publishes to its own exchange, and the next
> picks it up from a single queue bound to that exchange.  I am using
> fanout exchanges, as I gather they are fastest and my needs are
> simple.
> An alternative would be to use a single direct exchange, and bind the
> queues with different routing keys.  What are the pros and cons of
> this?  Is there anything else I could or should do?
> --
> mARK bLOORE <mbloore@gmail.com>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message