You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Serge Smertin (JIRA)" <ji...@apache.org> on 2015/08/25 13:33:45 UTC

[jira] [Updated] (CAMEL-9101) RabbitMQ specific message properties are forwarded as message headers

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

Serge Smertin updated CAMEL-9101:
---------------------------------
    Description: 
org.apache.camel.component.rabbitmq.RabbitMQProducer#buildProperties does not remove message headers from exchange after property is set, leading to message header pollution.

so constructs like 

{code}
final Object contentType = exchange.getIn().getHeader(RabbitMQConstants.CONTENT_TYPE);
        if (contentType != null) {
            properties.contentType(contentType.toString());
        }
{code}

must be rewritten as

{code}
final Object contentType = exchange.getIn().removeHeader(RabbitMQConstants.CONTENT_TYPE);
        if (contentType != null) {
            properties.contentType(contentType.toString());
        }
{code}

I don't think that these are used in business logic as this is solely transport specific.

  was:
org.apache.camel.component.rabbitmq.RabbitMQProducer#buildProperties does not remove message headers from exchange after property is set, leading to message header pollution.

so constructs like 

````
final Object contentType = exchange.getIn().getHeader(RabbitMQConstants.CONTENT_TYPE);
        if (contentType != null) {
            properties.contentType(contentType.toString());
        }
````

must be rewritten as

````
final Object contentType = exchange.getIn().removeHeader(RabbitMQConstants.CONTENT_TYPE);
        if (contentType != null) {
            properties.contentType(contentType.toString());
        }
````

I don't think that these are used in business logic as this is solely transport specific.


> RabbitMQ specific message properties are forwarded as message headers
> ---------------------------------------------------------------------
>
>                 Key: CAMEL-9101
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9101
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-rabbitmq
>    Affects Versions: 2.15.2
>            Reporter: Serge Smertin
>
> org.apache.camel.component.rabbitmq.RabbitMQProducer#buildProperties does not remove message headers from exchange after property is set, leading to message header pollution.
> so constructs like 
> {code}
> final Object contentType = exchange.getIn().getHeader(RabbitMQConstants.CONTENT_TYPE);
>         if (contentType != null) {
>             properties.contentType(contentType.toString());
>         }
> {code}
> must be rewritten as
> {code}
> final Object contentType = exchange.getIn().removeHeader(RabbitMQConstants.CONTENT_TYPE);
>         if (contentType != null) {
>             properties.contentType(contentType.toString());
>         }
> {code}
> I don't think that these are used in business logic as this is solely transport specific.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)