[
https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16553983#comment-16553983
]
Dmitry Volodin commented on CAMEL-12654:
----------------------------------------
[~Srivastav], I will backport this feature to the 2.22.1 and 2.21.3 versions.
To be able pass null values to the headers the allowNullHeaders endpoint and
component parameters were introduced.
Please see following test file as sample config
[RabbitMQProducerIntTest.java|https://github.com/apache/camel/commit/fddedbc44de60ccc214c0c40be420dad7e1d13da#diff-24dcd05dc15db65884aaba68ed79880b]
> RabbitMQ Headers - Headers with null value are skipped.
> -------------------------------------------------------
>
> Key: CAMEL-12654
> URL: https://issues.apache.org/jira/browse/CAMEL-12654
> Project: Camel
> Issue Type: Bug
> Components: camel-rabbitmq
> Affects Versions: 2.21.1
> Reporter: Prakhar
> Priority: Minor
> Labels: headers, rabbitmq
> Fix For: 2.22.1, 2.23.0, 2.21.3
>
>
> Reference: Conversation with Claus Ibsen on
> [Stackoverflow|https://stackoverflow.com/questions/50583749/apache-camel-how-to-setheader-value-as-null]
> org.apache.camel.component.rabbitmq.RabbitMQMessageConverter.buildProperties()
> skips the headers which have value null. The actual java client for RabbitMQ
> does not have this check. It accepts a basic Map<String,Object> which can
> accept null value.
> [Reference|https://rabbitmq.github.io/rabbitmq-java-client/api/current/com/rabbitmq/client/AMQP.BasicProperties.Builder.html]
> . Check the definition of headers() method
> *The business scenario where we use it*. On the RabbitMQ, we accept messages
> from multiple sources. Depending on whether a specific header is null or not,
> we route these message downstream in our processing pipeline.
> If required, I could provide a working example of rabbitmq java-client to
> demonstrate that the headers with null value are not skipped
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)