You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Peter Billen (JIRA)" <ji...@apache.org> on 2019/02/27 15:02:00 UTC

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

Peter Billen created CAMEL-13270:
------------------------------------

             Summary: 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


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.3#76005)