Shan Wang wrote:
Hi All,
I'm a bit confused about the c++ failover example replay_sender and
resume_receiver. What kind of exchange are they using?
In the declare_queue.cpp in examples/failover, it only uses the
following line to declare the queue:
session.queueDeclare(arg::queue="message_queue");
There are no routing_key bindings for this queue. And in
replay_sender.cpp, sender sets routing_key the same as the queue name:
message.getDeliveryProperties().setRoutingKey(queue);
here queue is "message_queue". In resume_receiver.cpp, listener
subscribes to the queue directly:
subscription = subs.subscribe(*this, "message_queue");
So do failover sender and receiver use any kind of exchange? Will the
direct/fanout/topic exchange code work on failover connections?
Yes, they do. AMQP specifies that every broker has a default "nameless"
exchange. This exchange is a direct exchange. When queues are created they are
automatically bound to this exchange by their name.
So you can send to any queue by using the empty string as an exchange name and
the queue name as routing key. This applies in general, its not specific to
failover.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]