Multiple dead letter queues per exchange

905 views
Skip to first unread message

pcam...@ukcloud.com

unread,
Nov 4, 2016, 10:03:52 AM11/4/16
to rabbitmq-users
I'm relatively new to the world of rabbit (but not messaging). I'm using rabbit in the context of Spring Cloud Data Flow which I'm evaluating as a potential solution for an internal project.

I have a question regarding dead letter queues. Is it possible to configure multiple dead letter queues for an exchange so that I can route failed messages depending on the failure condition e.g. downstream connection failures go to one DLQ and business logic failures (not bugs!) go to another queue or queues.

Is this possible or can it be emulated somehow? Spring Cloud Data Flow supports DLQs -- whether it supports what I want to do is another matter entirely!

cheers,
Peter

Michael Klishin

unread,
Nov 4, 2016, 10:06:06 AM11/4/16
to rabbitm...@googlegroups.com, pcam...@ukcloud.com
There is no such thing as dead letter queues. There are exchanges that act as dead letter exchanges
(DLX) for queues and then there are queues that are bound to the DLXes. Since a DLX is just an exchange,
you can declare and bind any number of queues to it. 
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Gary Russell

unread,
Nov 4, 2016, 10:19:27 AM11/4/16
to rabbitm...@googlegroups.com, pcam...@ukcloud.com
>I have a question regarding dead letter queues. Is it possible to configure multiple dead letter queues for an exchange so that I can route failed messages depending on the failure condition e.g. downstream connection failures go to one DLQ and business logic failures (not bugs!) go to another queue or queues.

While you can configure multiple queues on the DLX, the routing key for dead-letter messages are fixed so you can't change the routing based on the failure type (in fact there's no mechanism to communicate any information back to the broker).

SCStream does have an option to use a RepublishMessageRecoverer, in which case the binder republishes the message, to include additional information such as the exception message, stack trace etc, instead of using the broker's dead-letter routing. When using this recoverer, the message is acked normally. Again, however, the routing key for the republished message is fixed.

So, one option, would be to add a consumer on the queue bound to the DLX and redistribute the errors - re-routing them to your desired queues.


Since this group is for pure RabbitMQ issues/questions; if you need to discuss this further, please ask a question on Stack Overflow where Spring projects are supported.


On Fri, Nov 4, 2016 at 10:05 AM, Michael Klishin <mkli...@pivotal.io> wrote:
There is no such thing as dead letter queues. There are exchanges that act as dead letter exchanges
(DLX) for queues and then there are queues that are bound to the DLXes. Since a DLX is just an exchange,
you can declare and bind any number of queues to it. 

On 4 November 2016 at 14:03:57, pcam...@ukcloud.com (pcam...@ukcloud.com) wrote:
> I'm relatively new to the world of rabbit (but not messaging). I'm using
> rabbit in the context of Spring Cloud Data Flow which I'm evaluating as a
> potential solution for an internal project.
>
> I have a question regarding dead letter queues. Is it possible to configure
> multiple dead letter queues for an exchange so that I can route failed
> messages depending on the failure condition e.g. downstream connection
> failures go to one DLQ and business logic failures (not bugs!) go to
> another queue or queues.
>
> Is this possible or can it be emulated somehow? Spring Cloud Data Flow
> supports DLQs -- whether it supports what I want to do is another matter
> entirely!
>
> cheers,
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
> To post to this group, send an email to rabbitmq-users@googlegroups.com.

> For more options, visit https://groups.google.com/d/optout.
>

--
MK

Staff Software Engineer, Pivotal/RabbitMQ
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send an email to rabbitmq-users@googlegroups.com.

Michael Klishin

unread,
Nov 4, 2016, 10:21:43 AM11/4/16
to rabbitm...@googlegroups.com, Gary Russell, pcam...@ukcloud.com
Thank you, Gary, good point.

On 4 November 2016 at 14:19:28, Gary Russell (grus...@pivotal.io) wrote:
> >I have a question regarding dead letter queues. Is it possible to
> configure multiple dead letter queues for an exchange so that I can route
> failed messages depending on the failure condition e.g. downstream
> connection failures go to one DLQ and business logic failures (not bugs!)
> go to another queue or queues.
>
> While you can configure multiple queues on the DLX, the routing key for
> dead-letter messages are fixed so you can't change the routing based on the
> failure type (in fact there's no mechanism to communicate any information
> back to the broker).
>
> SCStream does have an option to use a RepublishMessageRecoverer, in which
> case the binder republishes the message, to include additional information
> such as the exception message, stack trace etc, instead of using the
> broker's dead-letter routing. When using this recoverer, the message is
> acked normally. Again, however, the routing key for the republished message
> is fixed.
>
> So, one option, would be to add a consumer on the queue bound to the DLX
> and redistribute the errors - re-routing them to your desired queues.
>
>
> Since this group is for pure RabbitMQ issues/questions; if you need to
> discuss this further, please ask a question on Stack Overflow where Spring
> projects are supported.
>
>
> On Fri, Nov 4, 2016 at 10:05 AM, Michael Klishin
> > an email to rabbitmq-user...@googlegroups.com.
> > > To post to this group, send an email to rabbitm...@googlegroups.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
> >
> > --
> > MK
> >
> > Staff Software Engineer, Pivotal/RabbitMQ
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "rabbitmq-users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to rabbitmq-user...@googlegroups.com.
> > To post to this group, send an email to rabbitm...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups "rabbitmq-users"
> group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
> To post to this group, send an email to rabbitm...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages