Accessing x-death header data from c# client

194 views
Skip to first unread message

Stephen Swensen

unread,
Feb 14, 2018, 10:03:45 AM2/14/18
to rabbitmq-users
Hello,

Is it possible to access the x-death header from the RabbitMQ C# client? Using the EventingBasicConsumer, the BasicDeliveryEventArgs available when receiving a message doesn't appear to provide access to the x-death count value for example. There is BasicDeliveryEventArgs.Redelivery that tells you if the message is at least once redelivered, and there is BasicDeliveryEventArgs.Headers but it only appears to contain custom headers.

Thanks!

Stephen

Michael Klishin

unread,
Feb 14, 2018, 12:13:20 PM2/14/18
to rabbitm...@googlegroups.com

--
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 email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Stephen Swensen

unread,
Feb 14, 2018, 12:55:38 PM2/14/18
to rabbitmq-users
Thanks for response, Michael -

I tried looking in BasicDeliveryEventArgs.BasicProperties.Headers but it doesn't contain the x-death key - it appears to only contain custom headers I set when publishing a message.


On Wednesday, February 14, 2018 at 12:13:20 PM UTC-5, Michael Klishin wrote:
On Wed, Feb 14, 2018 at 3:03 PM, Stephen Swensen <stephen...@gmail.com> wrote:
Hello,

Is it possible to access the x-death header from the RabbitMQ C# client? Using the EventingBasicConsumer, the BasicDeliveryEventArgs available when receiving a message doesn't appear to provide access to the x-death count value for example. There is BasicDeliveryEventArgs.Redelivery that tells you if the message is at least once redelivered, and there is BasicDeliveryEventArgs.Headers but it only appears to contain custom headers.

Thanks!

Stephen

--
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 email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Michael Klishin

unread,
Feb 14, 2018, 1:37:49 PM2/14/18
to rabbitmq-users
That likely means the message was never expired. You can inspect what's being
sent on the wire with Wireshark:
http://www.rabbitmq.com/amqp-wireshark.html.

Stephen Swensen

unread,
Feb 25, 2018, 8:40:36 PM2/25/18
to rabbitmq-users
I figured out my misunderstanding: I was doing a BasicNack with requeue=true and expecting the x-death header to be set, however that header doesn't get set unless / until we do a BasicNack with requeue=false and the message is actually dead-lettered.

Thanks for a helpful hand!

Stephen

Michael Klishin

unread,
Feb 26, 2018, 6:18:54 PM2/26/18
to rabbitm...@googlegroups.com
Ah, good point. Thank you for reporting back to the list!

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 email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages