You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/07/21 16:06:24 UTC

[GitHub] [activemq-artemis] brusdev opened a new pull request #3665: ARTEMIS-3396 Convert bytes properties to String for OpenWire

brusdev opened a new pull request #3665:
URL: https://github.com/apache/activemq-artemis/pull/3665


   


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3665: ARTEMIS-3396 Convert bytes properties to String for OpenWire

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #3665:
URL: https://github.com/apache/activemq-artemis/pull/3665#discussion_r674258633



##########
File path: artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java
##########
@@ -963,13 +965,14 @@ private static void setAMQMsgObjectProperties(final ActiveMQMessage amqMsg,
          try {
             if (prop instanceof SimpleString) {
                amqMsg.setObjectProperty(keyStr, prop.toString());
+            } else if (prop instanceof byte[]) {
+               ActiveMQServerLogger.LOGGER.propertyConvertedToString(keyStr, "byte[]");

Review comment:
       I'm not sure you should really log a warn for this. This looks regular business to me. it should just to it.




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3665: ARTEMIS-3396 Convert bytes properties to String for OpenWire

Posted by GitBox <gi...@apache.org>.
clebertsuconic commented on a change in pull request #3665:
URL: https://github.com/apache/activemq-artemis/pull/3665#discussion_r674258941



##########
File path: artemis-protocols/artemis-openwire-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverterTest.java
##########
@@ -91,4 +92,20 @@ public void createMessageDispatch() throws Exception {
       }
 
    }
+
+   @Test
+   public void testBytesPropertyConversionToString() throws Exception {
+      final String bytesPropertyKey = "bytesProperty";
+
+      ICoreMessage coreMessage = new CoreMessage().initBuffer(8);
+      coreMessage.putBytesProperty(bytesPropertyKey, "TEST".getBytes());
+
+      MessageReference messageReference = new MessageReferenceImpl(coreMessage, Mockito.mock(Queue.class));
+      AMQConsumer amqConsumer = Mockito.mock(AMQConsumer.class);
+      Mockito.when(amqConsumer.getOpenwireDestination()).thenReturn(destination);
+
+      MessageDispatch messageDispatch = OpenWireMessageConverter.createMessageDispatch(messageReference, coreMessage, openWireFormat, amqConsumer, nodeUUID);
+
+      Assert.assertTrue(messageDispatch.getMessage().getProperty(bytesPropertyKey) instanceof String);

Review comment:
       Can you add a test where it's actually sending a message and converting to OpenWire and 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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [activemq-artemis] brusdev commented on a change in pull request #3665: ARTEMIS-3396 Convert bytes properties to String for OpenWire

Posted by GitBox <gi...@apache.org>.
brusdev commented on a change in pull request #3665:
URL: https://github.com/apache/activemq-artemis/pull/3665#discussion_r674527818



##########
File path: artemis-protocols/artemis-openwire-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverterTest.java
##########
@@ -91,4 +92,20 @@ public void createMessageDispatch() throws Exception {
       }
 
    }
+
+   @Test
+   public void testBytesPropertyConversionToString() throws Exception {
+      final String bytesPropertyKey = "bytesProperty";
+
+      ICoreMessage coreMessage = new CoreMessage().initBuffer(8);
+      coreMessage.putBytesProperty(bytesPropertyKey, "TEST".getBytes());
+
+      MessageReference messageReference = new MessageReferenceImpl(coreMessage, Mockito.mock(Queue.class));
+      AMQConsumer amqConsumer = Mockito.mock(AMQConsumer.class);
+      Mockito.when(amqConsumer.getOpenwireDestination()).thenReturn(destination);
+
+      MessageDispatch messageDispatch = OpenWireMessageConverter.createMessageDispatch(messageReference, coreMessage, openWireFormat, amqConsumer, nodeUUID);
+
+      Assert.assertTrue(messageDispatch.getMessage().getProperty(bytesPropertyKey) instanceof String);

Review comment:
       I have just added the testBinaryPropertyConversionToString test converting from AMQP to OpenWire.




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [activemq-artemis] clebertsuconic merged pull request #3665: ARTEMIS-3396 Convert bytes properties to String for OpenWire

Posted by GitBox <gi...@apache.org>.
clebertsuconic merged pull request #3665:
URL: https://github.com/apache/activemq-artemis/pull/3665


   


-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org