You don't consume from an exchange, but from a queue,
and a Consumer can consume from multiple queues.
Consumer(channel, [q1, q2])
However, you may want to apply different QoS settings, then
you have to use multiple Consumers using different channels.
e.g:
c1 = Consumer(channel, [q1])
c1.qos(prefetch_count=10)
c1.register_callback(handle_message)
c1.consume()
c2 = Consumer(channel, [q2])
c2.qos(prefetch_count=10)
c2.register_callback(handle_broadcast_message)
c2.consume()
while 1:
connection.drain_events()
This way the limits imposed on the first channel,
won't affect broadcast messages.
--
Ask Solem
twitter.com/asksol | +44 (0)7713357179
something like:
broadcast_exchange=Exchange("fanout")
topic_exchange=Exchange("topic")
q1 = Queue(broadcast_exchange)
q2 = Queue(topic_exchange)
c1 = Consumer(channel, [q1, q2])
c1.register_callback(handle_incoming)
c1.consume()
while 1:
connection.drain_events()
?
-joe
> --
> You received this message because you are subscribed to the Google Groups "carrot-users" group.
> To post to this group, send email to carrot...@googlegroups.com.
> To unsubscribe from this group, send email to carrot-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/carrot-users?hl=en.
>
>