Description
When using the Camel ActiveMQComponent, if a message originated as a JMS message that did not come from ActiveMQ but is being sent to an ActiveMQ endpoint, then a ClassCastException will occur.
java.lang.ClassCastException: org.apache.qpid.client.message.JMSObjectMessage cannot be cast to org.apache.activemq.command.ActiveMQMessage at org.apache.activemq.camel.component.OriginalDestinationPropagateStrategy.onMessageCreated(OriginalDestinationPropagateStrategy.java:44) at org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:309)
Adding to the instanceof if block could prevent this issue.
if (message instanceof ActiveMQMessage && jms instanceof ActiveMQMessage) {