You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2019/08/06 19:13:00 UTC

[jira] [Updated] (CAMEL-13270) camel-rabbitmq - x-death header gets lost because of incorrect header value validation

     [ https://issues.apache.org/jira/browse/CAMEL-13270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-13270:
--------------------------------
    Fix Version/s: Future

> camel-rabbitmq - x-death header gets lost because of incorrect header value validation
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-13270
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13270
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-rabbitmq
>    Affects Versions: 2.23.0
>            Reporter: Peter Billen
>            Priority: Minor
>             Fix For: Future
>
>
> In `RabbitMQMessageConverter.java`, some kind of header value validation is done:
> {code:java}
>     private Object getValidRabbitMQHeaderValue(Object headerValue) {
>         if (headerValue instanceof String) {
>             return headerValue;
>         } else if (headerValue instanceof Number) {
>             return headerValue;
>         } else if (headerValue instanceof Boolean) {
>             return headerValue;
>         } else if (headerValue instanceof Date) {
>             return headerValue;
>         } else if (headerValue instanceof byte[]) {
>             return headerValue;
>         } else if (headerValue instanceof LongString) {
>             return headerValue;
>         }
>         return null;
>     }
> {code}
> While this is correct for the listed typed, this is incomplete. An example of this is the `x-death` header, as explained on https://www.rabbitmq.com/dlx.html#effects. This header is basically a `List<Map<String,Object>>`.
> If a message with such header is consumed and then propagated to another queue, the header will be lost. An example use case is consuming a dead-letter queue and propagating the messages to another queue, possible after some delay, until the `count` field in the `x-death` header reached a certain threshold.
> I am happy to provide a self-contained example if this would be helpful.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)