tabish121 commented on a change in pull request #2725: AETEMIS-2390 
JMSMessageID header can be null when messages are cross-protocol
URL: https://github.com/apache/activemq-artemis/pull/2725#discussion_r296241440
 
 

 ##########
 File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/CoreAmqpConverter.java
 ##########
 @@ -159,6 +160,12 @@ public static AMQPMessage fromCore(ICoreMessage 
coreMessage) throws Exception {
          } catch (ActiveMQAMQPIllegalStateException e) {
             properties.setMessageId(messageId);
          }
+      } else {
+         if (message.getInnerMessage().getUserID() != null) {
+            properties.setMessageId("ID:" + 
message.getInnerMessage().getUserID().toString());
+         } else {
+            properties.setMessageId("ID: " + 
UUIDGenerator.getInstance().generateStringUUID());
 
 Review comment:
   But JMS does allow a message to **not** have a message ID using the 
disableMessageId option on the producer.  Not all the clients might support 
this option but it they did then generating a new ID seems to go against the 
grain of this issue which is to meet expectations albeit in this case in the 
negative.  

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to