jdanekrh commented on a change in pull request #2725: ARTEMIS-2390 JMSMessageID
header can be null when messages are cross-protocol
URL: https://github.com/apache/activemq-artemis/pull/2725#discussion_r297139047
##########
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:
There should be a test for that. Lets say,
https://invent.kde.org/snippets/280
The results of that test on this PR at this moment (which is after the fix
mentioned above) are
```
x [sender=OPENWIRE,consumer=<anything>]
x [sender=CORE,consumer=OPENWIRE]
✓ [sender=CORE,consumer=CORE]
✓ [sender=CORE,consumer=AMQP]
x [sender=AMQP,consumer=OPENWIRE]
✓ [sender=AMQP,consumer=CORE]
✓ [sender=AMQP,consumer=AMQP]
```
----------------------------------------------------------------
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