ft420 wrote:
Hi,
session.exchangeDeclare(arg::exchange = "AlterExch", arg::type = "direct");
session.queueDeclare(arg::queue = "AlterQueue", arg::exclusive=false,
arg::autoDelete=false);
session.exchangeBind(arg::exchange = "AlterExch", arg::queue = "AlterQueue",
arg::bindingKey = "Alter_Key");
Note, this queue will only get messages whose routing-key is set to
"Alter-Key".
session.queueDeclare(arg::queue = "messageQ", arg::exclusive = false,
arg::autoDelete = false ,
arg::alternateExchange = "");
should the altenateExchange above be "AlterExch"?
session.exchangeBind(arg::exchange = "amq.direct", arg::queue = "messageQ",
arg::bindingKey = "routing_Key");
Also we have set setDiscardUnroutable(false);
message.getDeliveryProperties.setDiscardUnroutable(false);
and transfer the 10 messages to queue "messageQ" with acceptMode
ACCEPT_MODE_NONE.
Next we delete the messageQ queue containing 10 msgs, so as per concept of
alternate exchange these msgs should be re-routed to queue bound with the
alternate exchange, but its gets dropped.
The messages get routed to the alternate-exchange. They will only be
enqueued in queues whose bindings to that exchange match the message.
For a direct exchange this means that the binding key used must match
the routing key with which the message was first published.
qpid-tool and qpid-config was used
to view the queue , alternate-exchange status and delete the queue
respectively.
deleteing the "messageQ" if you check the status of the alternate-exchange
it shows msgReceives 10 and msgDrops 10.
Just need to know where exactly are we wrong.
You need to design the exchange type and bindings for your
alternate-exchange to be able to handle the cases you care about.
One suggestion is to use a fanout exchange as your alternate exchange.
That way any message routed to that exchange will be enqueued on all
bound queues. This makes it easier to have a single 'dead-letter' queue
for example.
Hope this helps,
--Gordon.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]