[
https://issues.apache.org/jira/browse/ARTEMIS-4657?focusedWorklogId=907217&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-907217
]
ASF GitHub Bot logged work on ARTEMIS-4657:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 27/Feb/24 21:17
Start Date: 27/Feb/24 21:17
Worklog Time Spent: 10m
Work Description: tabish121 commented on code in PR #4833:
URL: https://github.com/apache/activemq-artemis/pull/4833#discussion_r1505003120
##########
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java:
##########
@@ -590,9 +593,14 @@ private static ActiveMQMessage
toAMQMessage(MessageReference reference,
}
amqMsg.setCommandId(commandId);
- final SimpleString corrId = getObjectProperty(coreMessage,
SimpleString.class, OpenWireConstants.JMS_CORRELATION_ID_PROPERTY);
- if (corrId != null) {
- amqMsg.setCorrelationId(corrId.toString());
+ final Object correlationID = coreMessage.getCorrelationID();
+ if (correlationID != null) {
+ if (correlationID instanceof String || correlationID instanceof
SimpleString) {
Review Comment:
Can the core message carry something else besides SimpleString, String or
byte[] and if so should it be ignored as it is now? If not should the if be
inverted to simply check for byte[] and just toString anything else?
##########
artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/converter/message/AMQPMessageIdHelperTest.java:
##########
@@ -458,22 +459,21 @@ public void testToCorrelationIdStringWithUnsignedLong() {
}
/**
- * Test that {@link AMQPMessageIdHelper#toCorrelationIdString(Object)}
- * returns a string indicating an AMQP encoded binary when given a Binary
- * object.
+ * Test that {@link
AMQPMessageIdHelper#toCorrelationIdStringOrBytes(Object)}
+ * returns a byte[] when given a Binary object.
*/
@Test
- public void testToCorrelationIdStringWithBinary() {
+ public void testToCorrelationIdByteArrayWithBinary() {
byte[] bytes = new byte[] {(byte) 0x00, (byte) 0xAB, (byte) 0x09, (byte)
0xFF};
Binary binary = new Binary(bytes);
- String expected = AMQPMessageIdHelper.JMS_ID_PREFIX +
AMQPMessageIdHelper.AMQP_BINARY_PREFIX + "00AB09FF";
-
- doToCorrelationIDTestImpl(binary, expected);
+ Object idString = messageIdHelper.toCorrelationIdStringOrBytes(binary);
Review Comment:
If the result isn't expected to be a string then naming it 'idString' seems
misleading to the reader
Issue Time Tracking
-------------------
Worklog Id: (was: 907217)
Time Spent: 20m (was: 10m)
> Support correlation ID compatibility between JMS clients
> --------------------------------------------------------
>
> Key: ARTEMIS-4657
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4657
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Currently there are some use-cases with both {{String}} and {{byte[]}} values
> of JMS correlation ID that don't work between Core, OpenWire, and AMQP. We
> should support as many as possible.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)