Accessing rabbitmq message x-death header data in java

585 views
Skip to first unread message

Gregg Fiehler

unread,
Oct 15, 2016, 4:12:50 PM10/15/16
to rabbitmq-users
I am writing a dead letter manager in java for rabbitmq and I can get the message from the dead letter queue, access the properties, headers, then get the x-death header e.g.

[{reason=rejected, count=1, exchange=x1, time=Fri Oct 14 13:32:52 MST 2016, routing-keys=[mykey1], queue=q1}]

and I know there could be multiple tuples in the list if the queue+reason are not the same.  However, I have not found a practical way to parse out the fields in this string so that I can use them.  I tried using
http://www.metadave.net/etp/ but the parse failed on the '=' character with

1:8 token recognition error at: '='
com.metadave.etp.ETP$ParseException: ETP parse error

I also looked at jinterface, but that did not seem to be able to handle this issue either.  At this point I am looking at regex, but wanted to know how others were handling this or see if there are any better suggestions.

Any help is always appreciated.

Cheers,
Gregg

Michael Klishin

unread,
Oct 15, 2016, 5:44:31 PM10/15/16
to rabbitm...@googlegroups.com
Tables are parsed automatically by the client. What you are looking at is a string representation (probably because
you printed out the value).

--
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
Reply all
Reply to author
Forward
0 new messages