[
https://issues.apache.org/jira/browse/ARTEMIS-3396?focusedWorklogId=626446&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-626446
]
ASF GitHub Bot logged work on ARTEMIS-3396:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 22/Jul/21 06:21
Start Date: 22/Jul/21 06:21
Worklog Time Spent: 10m
Work Description: 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 626446)
Time Spent: 40m (was: 0.5h)
> MessageFormatException when consuming a message using OpenWire
> --------------------------------------------------------------
>
> Key: ARTEMIS-3396
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3396
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Reporter: Domenico Francesco Bruscino
> Assignee: Domenico Francesco Bruscino
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> CORE protocol supports messages with bytes properties not supported by
> OpenWire protocol. The broker fails to deliver a CORE message with a bytes
> property to an OpenWire consumer and logs a MessageFormatException:
> {code:java}
> java.io.IOException: exception setting property bytesProperty : [B@3e10dc6
> at
> org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverter.setAMQMsgObjectProperties(OpenWireMessageConverter.java:979)
> at
> org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverter.toAMQMessage(OpenWireMessageConverter.java:699)
> at
> org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverter.createMessageDispatch(OpenWireMessageConverter.java:504)
> at
> org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverterTest.testBytesProperty(OpenWireMessageConverterTest.java:108)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
> at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> at
> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
> at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
> at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
> at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> at
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
> at
> com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
> at
> com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
> at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
> Caused by: javax.jms.MessageFormatException: Only objectified primitive
> objects, String, Map and List types are allowed but was: [B@3e10dc6 type:
> class [B
> at
> org.apache.activemq.command.ActiveMQMessage.checkValidObject(ActiveMQMessage.java:538)
> at
> org.apache.activemq.command.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:504)
> at
> org.apache.activemq.command.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:488)
> at
> org.apache.activemq.artemis.core.protocol.openwire.OpenWireMessageConverter.setAMQMsgObjectProperties(OpenWireMessageConverter.java:976)
> ... 28 more{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)