tabish121 commented on a change in pull request #2954: ARTEMIS-2608 Fix
ClassCastException on binary properties conversion
URL: https://github.com/apache/activemq-artemis/pull/2954#discussion_r396669227
##########
File path:
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/converter/AmqpCoreConverter.java
##########
@@ -477,7 +477,7 @@ private static void setProperty(javax.jms.Message msg,
String key, Object value)
} else if (value instanceof Decimal32) {
msg.setFloatProperty(key, ((Decimal32) value).floatValue());
} else if (value instanceof Binary) {
- msg.setStringProperty(key, value.toString());
+ msg.setObjectProperty(key, ((Binary) value).getArray());
Review comment:
This isn't a complete fix as the Binary value may contain a subsequence of
some other array value possibly a slice from another buffer owned by someone
else so you need to copy this if the Binary has an array offset or relative
length value that doesn't match the underlying array otherwise you end up with
a value on the other side that doesn't match the original scoped array
contents.
----------------------------------------------------------------
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