Robert,
There probably is a difference in the data format being using by the
Camel and ServiceMix JMS receiver endpoints. Could you add a
.to("log:jms") or something similar to determine what the data format of
the message body is? You can also try explicitly converting the body
(e.g. using .convertBodyTo(String.class)) in your route just before you
send it to ActiveMQ.
Gert
Robert Thullner wrote:
James.Strachan wrote:
Could you post the code you're using to send the message please?
Sounds like something is a bit strange.
FWIW when using ActiveMQ a TextMessage should result in an
ActiveMQTextMessage being sent. If an ActiveMQMessage is received then
that usually indicates an empty body
Here is what I do:
This is how I send my message:
TextMessage statusInformationMessage = session.createTextMessage();
statusInformationMessage.setText(generateFlightPlan().toString());
statusInformationMessage.setStringProperty("test", "test");
statusInformationMessage.setJMSCorrelationID(""+System.currentTimeMillis());
producer.send(statusInformationMessage);
In ServiceMix I have configured a consumer endpoint which looks like this
<jms:endpoint service="splitter:receiveTravelplan"
endpoint="endpoint"
targetService="splitter:camelRouter"
role="consumer"
destinationStyle="queue"
jmsProviderDestinationName="camel.train.plan.queue"
defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
connectionFactory="#connectionFactory" />
At last my Camel route looks like this:
from("jbi:endpoint:http://eip.splitter.servicemix/camelRouter/endpoint")
.to("activemq:queue:camel.train.plan.queue.neusiedlsee");
Now I receive a message of type ActiveMQMessage in my JMS receiver.
I have made some more interesting observations:
When I do not use the JMS consumer service unit and also use the Camel JBI
to directly receive message, everything works fine. So when I use this camel
route in ServiceMix everything works fine and I receive an
ActiveMQTextMessage:
from("activemq:queue:camel.train.plan.queue")
.to("activemq:queue:camel.train.plan.queue.neusiedlsee");
My second observations is that: When I use the new JMS endpoints of
ServiceMix like <jms:consumer ...> for receiving JMS messages, I receive an
ActiveMQObjectMessage at my final receiver.
However I think, this all is a ServiceMix isssue and not a Camel issue, so
perhaps it is placed now on the wrong list.
Best regards,
Robert