You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/05/30 07:52:06 UTC

[GitHub] [rocketmq-spring] fangjian0423 commented on issue #83: RocketMQUtil#addUserProperties can override headers from rocketmq(eg topic, tags, queue id...)

fangjian0423 commented on issue #83: RocketMQUtil#addUserProperties can override headers from rocketmq(eg topic,tags,queue id...)
URL: https://github.com/apache/rocketmq-spring/issues/83#issuecomment-497240395
 
 
   I wrote a test case about this:
   
   ```java
   @Test
   public void testRocketMQPrefixHeader() {
       org.apache.rocketmq.common.message.Message rmqMsg = new org.apache.rocketmq.common.message.Message();
       rmqMsg.setBody("test body".getBytes());
       rmqMsg.setTags("tags");
       rmqMsg.putUserProperty(RocketMQUtil.toRocketHeaderKey("TAGS"), "tags2");
       Message springMsg = RocketMQUtil.convertToSpringMessage(rmqMsg);
       System.out.println(springMsg.getHeaders().get(RocketMQUtil.toRocketHeaderKey("TAGS")));
   }
   ```
   
   console print: tags2

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


With regards,
Apache Git Services