[ 
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: 3.0.0.RC3

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.0.0, 3.0.0.RC3
>
>
> 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
(v8.3.4#803005)

Reply via email to