qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Robie <jonathan.ro...@redhat.com>
Subject Re: How to know when a message could not be enqueued?
Date Thu, 01 Oct 2009 20:05:07 GMT
One way is to create a "dead letter queue" that receives messages that 
could not be delivered, and bind it to a "dead letter exchange". 

session.exchangeDeclare(arg::exchange="deadletter.exchange", arg::type="fanout");
session.queueDeclare(arg::queue="deadletter_queue");
session.exchangeBind(arg::exchange="deadletter.exchange", arg::queue="deadletter.queue");

Now declare the exchange you will publish to, using the alternateExchange property to specify
a dead letter exchange:
 
session.exchangeDeclare(arg::exchange="my.topic", arg::type="topic", arg::alternatExchange="deadletter.exchange");

If an alternate exchange is specified, messages that can not be 
delivered to any queue are sent to the alternate exchange.

Jonathan

Acácio Centeno wrote:
> Hi,
>
>  
>
>                 How do a producer app knows when a message could not be
> delivered? I post a message to a queue that does not exist, and the QPid log
> states:
>
>  
>
> 2009-oct-01 14:00:35 info DirectExchange amq.direct could not route message
> with key bridge.account.usage; no matching binding found
>
>  
>
>                 But the application receives no indication about the
> problem. 
>
>  
>
> Thanks,
>
> Acácio.
>
>
>   


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message