[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553976#comment-16553976 ] Prakhar commented on CAMEL-12654: - [~dmvolod]. Amazing work. Few questions? * These updates would be available for which camel versions? * Could you please provide quick steps on how to use this feature. I will update the original question on StackOverflow. > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553955#comment-16553955 ] ASF GitHub Bot commented on CAMEL-12654: asfgit closed pull request #2436: CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped URL: https://github.com/apache/camel/pull/2436 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc b/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc index e6e330c384e..823f22b7fbc 100644 --- a/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc +++ b/components/camel-rabbitmq/src/main/docs/rabbitmq-component.adoc @@ -47,14 +47,14 @@ exchange name determines which exchange the queue will bind to. === Options // component options: START -The RabbitMQ component supports 49 options, which are listed below. +The RabbitMQ component supports 50 options, which are listed below. [width="100%",cols="2,5,^1,2",options="header"] |=== | Name | Description | Default | Type -| *hostname* (common) | The hostname of the running rabbitmq instance or cluster. | | String +| *hostname* (common) | The hostname of the running RabbitMQ instance or cluster. | | String | *portNumber* (common) | Port number for the host with the running rabbitmq instance or cluster. | 5672 | int | *username* (security) | Username in case of authenticated access | guest | String | *password* (security) | Password for authenticated access | guest | String @@ -102,6 +102,7 @@ The RabbitMQ component supports 49 options, which are listed below. | *deadLetterQueue* (common) | The name of the dead letter queue | | String | *deadLetterRoutingKey* (common) | The routing key for the dead letter exchange | | String | *deadLetterExchangeType* (common) | The type of the dead letter exchange | direct | String +| *allowNullHeaders* (producer) | Allow pass null values to header | false | boolean | *resolveProperty Placeholders* (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean |=== // component options: END @@ -126,7 +127,7 @@ with the following path and query parameters: |=== - Query Parameters (61 parameters): + Query Parameters (62 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -163,6 +164,7 @@ with the following path and query parameters: | *exceptionHandler* (consumer) | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored. | | ExceptionHandler | *exchangePattern* (consumer) | Sets the exchange pattern when the consumer creates an exchange. | | ExchangePattern | *threadPoolSize* (consumer) | The consumer uses a Thread Pool Executor with a fixed number of threads. This setting allows you to set that number of threads. | 10 | int +| *allowNullHeaders* (producer) | Allow pass null values to header | false | boolean | *bridgeEndpoint* (producer) | If the bridgeEndpoint is true, the producer will ignore the message header of rabbitmq.EXCHANGE_NAME and rabbitmq.ROUTING_KEY | false | boolean | *channelPoolMaxSize* (producer) | Get maximum number of opened channel in pool | 10 | int | *channelPoolMaxWait* (producer) | Set the maximum number of milliseconds to wait for a channel from the pool | 1000 | long diff --git a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java index 96c1ac8dfac..69a3e8ac34d 100644 --- a/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java +++ b/components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQComponent.java @@ -81,6 +81,8 @@ private String deadLetterQueue; @Metadata(label = "common", defaultValue = "direct", enums = "direct,fanout,headers,topic") private String deadLetterExchangeType = "direct"; +@Metadata(label = "producer") +private boolean allowNullHeaders; @Metadata(label = "security") private String sslProtocol; @Metadata(label = "security") @@ -241,6 +243,7 @@ protected RabbitMQEndpoint createEndpoint(String uri, endpoint.setDeadLetterExchangeType(getDeadLetterExchangeType()); endpoint.setDeadLetterQueue(getDeadLetterQueue());
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553956#comment-16553956 ] ASF GitHub Bot commented on CAMEL-12654: Github user asfgit closed the pull request at: https://github.com/apache/camel/pull/2436 > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553951#comment-16553951 ] ASF GitHub Bot commented on CAMEL-12654: dmvolod commented on issue #2436: CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped URL: https://github.com/apache/camel/pull/2436#issuecomment-407323263 @oscerd , thanks. Will do it. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553950#comment-16553950 ] ASF GitHub Bot commented on CAMEL-12654: oscerd commented on issue #2436: CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped URL: https://github.com/apache/camel/pull/2436#issuecomment-407322949 Should be fine if the behavior doesn't change it would be good. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553948#comment-16553948 ] ASF GitHub Bot commented on CAMEL-12654: dmvolod commented on issue #2436: CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped URL: https://github.com/apache/camel/pull/2436#issuecomment-407321828 @oscerd what do you think about backport this component to 2.21 and 2.22. I've added a new option but it doesn't change the default behaviour? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553944#comment-16553944 ] ASF GitHub Bot commented on CAMEL-12654: GitHub user dmvolod opened a pull request: https://github.com/apache/camel/pull/2436 CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped You can merge this pull request into a Git repository by running: $ git pull https://github.com/dmvolod/camel CAMEL-12654 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/2436.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2436 commit fddedbc44de60ccc214c0c40be420dad7e1d13da Author: Dmitry Volodin Date: 2018-07-24T08:08:45Z CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16553943#comment-16553943 ] ASF GitHub Bot commented on CAMEL-12654: dmvolod opened a new pull request #2436: CAMEL-12654: RabbitMQ Headers - Headers with null value are skipped URL: https://github.com/apache/camel/pull/2436 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552603#comment-16552603 ] Prakhar commented on CAMEL-12654: - [~dmvolod] Yes, actually I should have mentioned that specifically that this problem occurs for the custom headers. Proposal for allowNullHeaders looks good. > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552496#comment-16552496 ] Dmitry Volodin commented on CAMEL-12654: [~Srivastav] I've done some unit test with the headers (null and non-null values) and logger info if following: AMQP.BasicProperties: #contentHeader(content-type=null, content-encoding=null, headers=\{breadcrumbId=ID-dvolodin-redhat-local-1532335144940-0-1, CustomHeader=customheader}, delivery-mode=null, priority=null, correlation-id=null, reply-to=null, expiration=null, message-id=null, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null) You can see that's possible to pass null values in headers which are mapped to the AMQP properties, i.e. user-id, app-id, etc. but not custom headers or RabbitMQ specific headers, for example rabbitmq.EXCHANGE_NAME. We will continue to work on unit tests and add allowNullHeaders to the endpoint property to implement your requirements. > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552451#comment-16552451 ] Prakhar commented on CAMEL-12654: - [~dmvolod] Yes I agree. Something like setNullHeader('headerName') should suffice. We don't need to pass any value, as it would be null anyway. > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16550845#comment-16550845 ] Dmitry Volodin commented on CAMEL-12654: [~Srivastav], thanks for explanation. Looks like this is useful feature, but it must be added as an option (allowNullHeaders or something else) to provide backward compatibility. > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16550831#comment-16550831 ] Prakhar commented on CAMEL-12654: - Consider this scenario. System A produces a message (For example Customer submitting his electric meter reading) to rabbitmq exchange. This message is passed in sequence through 3 systems --> System 1 (performs a check if submitted through the Online interface) --> Adds header (Online : /null) --> System 2 (more checks...) --> Adds header (PreviousBalance : /null) --> System 3 (more chesks) --> Adds header (ClearByInvoiceService : /null) ... ... ... --> System B --> Does final processing System B processes this message. If either of the headers is set, it does a microservice lookup to get more details to enrich the base message. This works fine until we started reading the message from another system C. System C can directly send this message to System B, but it needs to setup headers with a null value. So far we have been using a set of POJO based rabbit-mq consumers and producers to read messages and do ETL operations. Now we have started porting many of our integrations to apache camel, but we are not able to use camel-rabbitmq component, because headers with null values are skipped. It would be good to have camel-rabbitmq not to filter out the header with null values like the original rabbitmq java-client does. Another factor which adds to the complexity is, there are multiple systems similar to System A, owned by different IT teams (and different programming languages). Making changes to System B would mean breaking message structure for rest of the parties which is additional cost and effort. We can actually fork the camel-rabbitmq component and fix the changes. But that would mean, we have to maintain this fork for all the versions that we would use. > 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 > > 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 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)
[jira] [Commented] (CAMEL-12654) RabbitMQ Headers - Headers with null value are skipped.
[ https://issues.apache.org/jira/browse/CAMEL-12654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16545123#comment-16545123 ] Dmitry Volodin commented on CAMEL-12654: [~Srivastav] you can check if the header not found this means it's a null. Could you please provide an example where null header values are required but header absence is not enough. > 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 > > 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 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)