Hello,
I've stumbled upon behavior in Camel + Artemis JMS that I do not understand.
Camel messages with bodies of type byte[] are treated as "large messages" in 
Artemis - even small messages with only three bytes.
In combination with "manually" polling the messages from JMS using a Camel 
ConsumerTemplate, that leads to exceptions like:

Caused by: org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException: 
AMQ119023: The large message lost connection with its session, either because 
of a rollback or a closed session
        at 
org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl.saveBuffer(LargeMessageControllerImpl.java:273)
 ~[artemis-core-client-2.6.2.jar:2.6.2]
        at 
org.apache.activemq.artemis.core.client.impl.ClientLargeMessageImpl.saveToOutputStream(ClientLargeMessageImpl.java:115)
 ~[artemis-core-client-2.6.2.jar:2.6.2]
        at 
org.apache.activemq.artemis.jms.client.ActiveMQMessage.saveToOutputStream(ActiveMQMessage.java:853)
 ~[artemis-jms-client-2.6.2.jar:2.6.2]
        at 
org.apache.activemq.artemis.jms.client.ActiveMQMessage.setObjectProperty(ActiveMQMessage.java:693)
 ~[artemis-jms-client-2.6.2.jar:2.6.2]
        at 
org.apache.camel.component.jms.JmsBinding.createByteArrayFromBytesMessage(JmsBinding.java:251)
 ~[camel-jms-2.22.1.jar:2.22.1]
        at 
org.apache.camel.component.jms.JmsBinding.extractBodyFromJms(JmsBinding.java:163)
 ~[camel-jms-2.22.1.jar:2.22.1]
        ... 21 more

The problem does not occur when converting my byte[] bodies to Byte[].
I have described the problem in more detail in the following StackOverflow 
question:
https://stackoverflow.com/q/59651341/827950

My minimal test setup is based on Camel 2.22.1 and Artemis 2.10.1. I have 
reproduced the phenomenon that Artemis handles the messages as large messages 
with Camel 3.0.0 as well, but I do not (yet) have a minimal example that leads 
to the same exception when using ConsumerTemplate for that Camel version.

Basically, I have two questions:
1) Why does Artemis treat small byte array messages sent via Camel as large 
messages?
2) Does Camel ConsumerTemplate support streamed large messages?

Best regards,
Florian

Reply via email to