You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/09/17 09:43:55 UTC

[GitHub] [camel] rgannu opened a new pull request #4241: CAMEL-15496: Add support for additional headers and properties

rgannu opened a new pull request #4241:
URL: https://github.com/apache/camel/pull/4241


   The additional headers will be added on top of the existing headers
   from the message.
   
   The properties added are only basic AMQP properties as defined in the
    {@link com.rabbitmq.client.AMQP.BasicProperties.Builder}. When the
   message contains already these properties then will be considered and
   these additional properties will be ignored.
   
   Introduced a SimpleDataHolderBean to hold a hashmap for adding any
   header. Changed the RabbitMQConstants to Enum so that we can also add
   the property description in that.
   
   The rabbitmq AMQP basic properties constant keys should not
   have dot in their prefixes. This gives problem in trying to
   retrieve the value due to fix of CAMEL-15394.
   
   As with this fix though we can add any header, only static/hard-coded
   values could be associated.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490163365



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       Header names are not changed.. I checked myself... 
   For my PR, I added support to add via the sink connector configuration way to add any Basic AMQP properties as 
   
   ```
   "camel.sink.endpoint.additionalProperties": "#bean:addProperties",
   
   "camel.beans.addProperties": "#class:org.apache.camel.support.beans.SimpleDataHolderBean",
   "camel.beans.addProperties.mapData[rabbitmq-CONTENT_TYPE]": "application/octet-stream",
   "camel.beans.addProperties.mapData["camel.sink.endpoint.additionalProperties": "#bean:addProperties",
   
   "camel.beans.addProperties": "#class:org.apache.camel.support.beans.SimpleDataHolderBean",
   "camel.beans.addProperties.mapData[rabbitmq-CONTENT_TYPE]": "application/octet-stream",
   "camel.beans.addProperties.mapData[rabbitmq-CONTENT_ENCODING]": "binary",
   rabbitmq-CONTENT_ENCODING]": "binary",
   
   ```
   
   When the property value is given as `mapData[rabbitmq.CONTENT_TYPE]`, due to the fix done as part of CAMEL-15394, 
   https://github.com/apache/camel/blob/master/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java#L408
   the property is split into parts and then we are trying to search for property value for `CONTENT_TYPE]` which will not be there. 
   
   I do not want to change this part and so I can in RabbitMQConstants.java
    - Remove the prefix `rabbitmq.` or
    - Change the prefix to `rabbitmq-` (which is what I have done)
   Both of these solution works, without changing the changes done for CAMEL-15394.
   
   Also the properties get set properly in the AMQP message as this is based on the com.rabbitmq.client.AMQP.BasicProperties in which we need to explicitly set the basic AMQP properties. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
oscerd commented on pull request #4241:
URL: https://github.com/apache/camel/pull/4241#issuecomment-694171773


   > I am using IntelliJ and I couldn't format the files..
   > I imported the code-style from `buildingtools/src/main/resources/camel-eclipse-formatter-config.xml`
   > 
   > `mvn install -Psourcecheck` always fails.
   > 
   > > [ERROR] Failed to execute goal org.apache.camel:camel-format-plugin:3.6.0-SNAPSHOT:validate (validate) on project camel-core: File '/home/ganesh/IdeaProjects/github/camel-unifly/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java' has not been previously formatted.  Please format file and commit before running validation! -> [Help 1]
   > 
   > Can you please let me know which code-formatter is used by all ?
   
   you just need to build the entire project and it will be auto-formatted.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on pull request #4241:
URL: https://github.com/apache/camel/pull/4241#issuecomment-701351795


   Even after repeated attempts to rebase and merge I am getting failures in the checkstyle step. 
   I will close this PR and open a new PR from master.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490261481



##########
File path: components/camel-as2/camel-as2-api/pom.xml
##########
@@ -127,7 +127,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Agreed. Thanks. 
   I will remove these changes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490193609



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       > Rabbitmq. Was the original prefix, now it's rabbitmq-.. anyone using the header explicitly will have his route broken.
   
   I understand completely. 
   Earlier my PR to support adding property with `mapData[rabbitmq.CONTENT_TYPE]` was working fine in camel-3.4.0.
   
   I had to submit the PR against the master and this is an enhancement work. 
   When I did the changes against the master, I started getting problems that the none of the properties getting their value set due to the changes done in CAMEL-15394. 
   
   Now, please let me know how I can fix this. 
   Without the changes to the **prefix so that it doesn't contain the dot (.) character, I couldn't submit this PR**.  
   I hope you understand my problem.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490166857



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       You don't have to think only about camel kafka connector, this is something related to pure camel too




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu closed pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu closed pull request #4241:
URL: https://github.com/apache/camel/pull/4241


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490193609



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       > Rabbitmq. Was the original prefix, now it's rabbitmq-.. anyone using the header explicitly will have his route broken.
   I understand completely. 
   Earlier my PR to support adding property with `mapData[rabbitmq.CONTENT_TYPE]` was working fine in camel-3.4.0.
   
   I had to submit the PR against the master and this is an enhancement work. 
   When I did the changes against the master, I started getting problems that the none of the properties getting their value set due to the changes done in CAMEL-15394. Now, please let me know how I can fix this. Without the changes to the prefix so that it doesn't contain the dot (.) character, I couldn't submit this PR.  
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490193609



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       > Rabbitmq. Was the original prefix, now it's rabbitmq-.. anyone using the header explicitly will have his route broken.
   
   I understand completely. 
   Earlier my PR to support adding property with `mapData[rabbitmq.CONTENT_TYPE]` was working fine in camel-3.4.0.
   
   I had to submit the PR against the master and this is an enhancement work. 
   When I did the changes against the master, I got `null` value for all properties (with prefix `rabbitmq.`), due to the changes done in CAMEL-15394. As the values is `null` these properties were removed from getting set as part of the AMQP header.
   
   Now, please let me know how I can fix this. 
   Without the changes to the **prefix so that it doesn't contain the dot (.) character, I couldn't submit this PR**.  
   I hope you understand my problem.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490209755



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       now I'm getting the point.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490114110



##########
File path: archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
##########
@@ -78,7 +78,7 @@
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-javadoc-plugin</artifactId>
             <configuration>
-              <additionalparam>-Xdoclint:none</additionalparam>
+              <doclint>none</doclint>

Review comment:
       This seems to be wrong

##########
File path: components/camel-as2/camel-as2-api/pom.xml
##########
@@ -127,7 +127,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Seems to be not related to this PR, please rebuild the whole project

##########
File path: components/camel-fhir/camel-fhir-api/pom.xml
##########
@@ -92,7 +92,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Ditto

##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       This will breaks existing users and I don't see a good reason for this

##########
File path: components/camel-olingo4/camel-olingo4-api/pom.xml
##########
@@ -136,7 +136,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       This seems wrong, please rebuild the whole project

##########
File path: components/camel-olingo2/camel-olingo2-api/pom.xml
##########
@@ -122,7 +122,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       This seems wrong, please rebuild the whole project

##########
File path: components/camel-box/camel-box-api/pom.xml
##########
@@ -87,7 +87,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Ditto

##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       Also you're changing the headers name. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490171589



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       so it's -1 for me.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on pull request #4241:
URL: https://github.com/apache/camel/pull/4241#issuecomment-694161013


   I am using IntelliJ and I couldn't format the files.. 
   I imported the code-style from `buildingtools/src/main/resources/camel-eclipse-formatter-config.xml`
   
   `mvn install -Psourcecheck` always fails. 
   
   > [ERROR] Failed to execute goal org.apache.camel:camel-format-plugin:3.6.0-SNAPSHOT:validate (validate) on project camel-core: File '/home/ganesh/IdeaProjects/github/camel-unifly/core/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java' has not been previously formatted.  Please format file and commit before running validation! -> [Help 1]
   
   Can you please let me know which code-formatter is used by all ?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490193609



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       > Rabbitmq. Was the original prefix, now it's rabbitmq-.. anyone using the header explicitly will have his route broken.
   I understand completely. 
   Earlier my PR to support adding property with `mapData[rabbitmq.CONTENT_TYPE]` was working fine in camel-3.4.0.
   
   I had to submit the PR against the master and this is an enhancement work. 
   When I did the changes against the master, I started getting problems that the none of the properties getting their value set due to the changes done in CAMEL-15394. 
   
   Now, please let me know how I can fix this. 
   Without the changes to the **prefix so that it doesn't contain the dot (.) character, I couldn't submit this PR**.  
   I hope you understand my problem.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490163365



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       Header names are not changed.. I checked myself... 
   For my PR, I added support to add via the sink connector configuration way to add any Basic AMQP properties as 
   
    `    
   "camel.sink.endpoint.additionalProperties": "#bean:addProperties",
   
   "camel.beans.addProperties": "#class:org.apache.camel.support.beans.SimpleDataHolderBean",
   "camel.beans.addProperties.mapData[rabbitmq-CONTENT_TYPE]": "application/octet-stream",
   "camel.beans.addProperties.mapData[rabbitmq-CONTENT_ENCODING]": "binary",
   `
   When the property value is given as `mapData[rabbitmq.CONTENT_TYPE]`, due to the fix done as part of CAMEL-15394, 
   https://github.com/apache/camel/blob/master/core/camel-support/src/main/java/org/apache/camel/support/PropertyBindingSupport.java#L408
   the property is split into parts and then we are trying to search for property value for `CONTENT_TYPE]` which will not be there. 
   
   I do not want to change this part and so I can in RabbitMQConstants.java
    - Remove the prefix `rabbitmq.` or
    - Change the prefix to `rabbitmq-` (which is what I have done)
   Both of these solution works, without changing the changes done for CAMEL-15394.
   
   Also the properties get set properly in the AMQP message as this is based on the com.rabbitmq.client.AMQP.BasicProperties in which we need to explicitly set the basic AMQP properties. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] oscerd commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
oscerd commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490165007



##########
File path: components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQConstants.java
##########
@@ -16,42 +16,76 @@
  */
 package org.apache.camel.component.rabbitmq;
 
-public final class RabbitMQConstants {
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public enum RabbitMQConstants {
 
     // TODO need to change the constant which is start with camel
-    public static final String ROUTING_KEY = "rabbitmq.ROUTING_KEY";
-    public static final String EXCHANGE_OVERRIDE_NAME = "rabbitmq.EXCHANGE_OVERRIDE_NAME";
-    public static final String EXCHANGE_NAME = "rabbitmq.EXCHANGE_NAME";
-    public static final String CONTENT_TYPE = "rabbitmq.CONTENT_TYPE";
-    public static final String PRIORITY = "rabbitmq.PRIORITY";
-    public static final String DELIVERY_TAG = "rabbitmq.DELIVERY_TAG";
-    public static final String REDELIVERY_TAG = "rabbitmq.REDELIVERY_TAG";
-    public static final String CORRELATIONID = "rabbitmq.CORRELATIONID";
-    public static final String MESSAGE_ID = "rabbitmq.MESSAGE_ID";
-    public static final String DELIVERY_MODE = "rabbitmq.DELIVERY_MODE";
-    public static final String USERID = "rabbitmq.USERID";
-    public static final String CLUSTERID = "rabbitmq.CLUSTERID";
-    public static final String REQUEST_TIMEOUT = "rabbitmq.REQUEST_TIMEOUT";
-    public static final String REPLY_TO = "rabbitmq.REPLY_TO";
-    public static final String CONTENT_ENCODING = "rabbitmq.CONTENT_ENCODING";
-    public static final String TYPE = "rabbitmq.TYPE";
-    public static final String EXPIRATION = "rabbitmq.EXPIRATION";
-    public static final String TIMESTAMP = "rabbitmq.TIMESTAMP";
-    public static final String APP_ID = "rabbitmq.APP_ID";
-    public static final String REQUEUE = "rabbitmq.REQUEUE";
-    public static final String MANDATORY = "rabbitmq.MANDATORY";
-    public static final String IMMEDIATE = "rabbitmq.IMMEDIATE";
-    public static final String RABBITMQ_DEAD_LETTER_EXCHANGE = "x-dead-letter-exchange";
-    public static final String RABBITMQ_DEAD_LETTER_ROUTING_KEY = "x-dead-letter-routing-key";
-    public static final String RABBITMQ_DIRECT_REPLY_EXCHANGE = "";
-    public static final String RABBITMQ_DIRECT_REPLY_ROUTING_KEY = "amq.rabbitmq.reply-to";
-    public static final String RABBITMQ_QUEUE_LENGTH_LIMIT_KEY = "x-max-length";
-    public static final String RABBITMQ_QUEUE_MAX_PRIORITY_KEY = "x-max-priority";
-    public static final String RABBITMQ_QUEUE_MESSAGE_TTL_KEY = "x-message-ttl";
-    public static final String RABBITMQ_QUEUE_TTL_KEY = "x-expires";
-    public static final String RABBITMQ_QUEUE_SINGLE_ACTIVE_CONSUMER_KEY = "x-single-active-consumer";
-
-    private RabbitMQConstants() {
-        // Constants class
+    ROUTING_KEY("rabbitmq-ROUTING_KEY", "The routing key that will be used when sending the message"),

Review comment:
       Rabbitmq. Was the original prefix, now it's rabbitmq-.. anyone using the header explicitly will have his route broken.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] rgannu commented on a change in pull request #4241: CAMEL-15496: Add support for additional headers and properties

Posted by GitBox <gi...@apache.org>.
rgannu commented on a change in pull request #4241:
URL: https://github.com/apache/camel/pull/4241#discussion_r490261588



##########
File path: components/camel-box/camel-box-api/pom.xml
##########
@@ -87,7 +87,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Agreed. Thanks. 
   I will remove these changes.

##########
File path: components/camel-olingo2/camel-olingo2-api/pom.xml
##########
@@ -122,7 +122,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Agreed. Thanks. 
   I will remove these changes.

##########
File path: components/camel-olingo4/camel-olingo4-api/pom.xml
##########
@@ -136,7 +136,7 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <configuration>
-                            <additionalparam>-Xdoclint:none</additionalparam>
+                            <doclint>none</doclint>

Review comment:
       Agreed. Thanks. 
   I will remove these changes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org