This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 76b9c62311 ARTEMIS-4098 AMQP messages missing correlation ID in console
76b9c62311 is described below
commit 76b9c623111c6484ea98d10b7c705c8d5e39b8f0
Author: Justin Bertram <[email protected]>
AuthorDate: Wed Nov 23 13:54:47 2022 -0600
ARTEMIS-4098 AMQP messages missing correlation ID in console
---
.../apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java | 3 +++
.../activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
index bad9749b82..df3bdeda73 100644
---
a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
+++
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
@@ -919,6 +919,9 @@ public abstract class AMQPMessage extends RefCountMessage
implements org.apache.
if (properties.getReplyTo() != null) {
map.put(propertiesPrefix + "replyTo", properties.getReplyTo());
}
+ if (properties.getCorrelationId() != null) {
+ map.put(propertiesPrefix + "correlationId",
properties.getCorrelationId());
+ }
}
return map;
diff --git
a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java
b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java
index b49816b7dc..9114ef0bd1 100644
---
a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java
+++
b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessageTest.java
@@ -2251,6 +2251,7 @@ public class AMQPMessageTest {
long testExpiryTime = testCreationTime + 5000;
String testSubject = "testSubject";
String testMessageId = "testMessageId";
+ String testCorrelationId = "testCorrelationId";
Properties protonProperties = new Properties();
protonProperties.setContentType(Symbol.valueOf(AMQPMessageSupport.OCTET_STREAM_CONTENT_TYPE));
@@ -2263,6 +2264,7 @@ public class AMQPMessageTest {
protonProperties.setSubject(testSubject);
protonProperties.setTo(TEST_TO_ADDRESS);
protonProperties.setMessageId(testMessageId);
+ protonProperties.setCorrelationId(testCorrelationId);
protonMessage.setProperties(protonProperties);
@@ -2284,13 +2286,12 @@ public class AMQPMessageTest {
assertTrue(properties.contains(PROPERTY_MAP_PROPERTIES_PREFIX +
"absoluteExpiryTime" + "=" + testExpiryTime));
assertTrue(properties.contains(PROPERTY_MAP_PROPERTIES_PREFIX + "to" +
"=" + TEST_TO_ADDRESS));
assertTrue(properties.contains(PROPERTY_MAP_PROPERTIES_PREFIX +
"subject" + "=" + testSubject));
+ assertTrue(properties.contains(PROPERTY_MAP_PROPERTIES_PREFIX +
"correlationId" + "=" + testCorrelationId));
// TODO: should these fields be included in the 'properties' string and
tested above?
// Some are shown elsewhere in a way, others missing entirely. Eg:
//
- // correlation-id: not included.
// message-id: included'ish, with an ID: prefix added, as the
CompositeDataConstants.USER_ID.
- // reply-to: not included, though the replyToGroupId is given as shown
above.
// user-id: not included.
// Some fields of the properties section already align with fields given