camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen">
Subject RE: Bridging the ActiveMQ with IBM Websphere using Camel
Date Tue, 23 Sep 2008 08:42:21 GMT

What version of Camel are you using? There have been a lot of activities on Camel 1.3, 1.4
and 1.5 (in progress). So it's good to know what you use.

Camel-jms will filter out any non JMS-spec valid headers. This is done by iterating the headers
and check if the object type is not a valid one:

See the source: JmsBinding, JmsHeaderFilterStrategy

You set some MQ specific types and thus they are probably filtered out as they are not valid
JMS types. Can't you use String, Integer or the likes? 

Camel sends the JMS message based on the payload type either as a:
See source: JmsBinding

What kind of payload are you sending?

We have a ticket for a RFE where you can configure Camel to use a fixed type so you can force
it to send TextMessage.

Try setting DEBUG/TRACE logging to: org.apache.camel.component.jms
And see what it logs

You can also try to set a fixed message to send in your Processor code.

exchange.getIn.setBody("Hello World");
exchange.getIn.setHeader("foo", "bar");

Med venlig hilsen
Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576

-----Original Message-----
From: JavaRat [] 
Sent: 23. september 2008 10:29
Subject: Bridging the ActiveMQ with IBM Websphere using Camel

Camel seems too be a most interesting and promising keycomponent in our work
and we have thrown ourselves into trying its potentials. However while
trying to bridge an ActiveMQqueue with an IBM MQ websphere queue we have
discovered the following problem (please see attached picture). camelissue.jpeg 

Messages taken off the Active MQ queue and delivered onto the IBM MQ
Websphere queue which is good and what we want. However the messages will
not have the specific parameters set in the JMS header and it's payload
Hopefully this is an error from our part but without success we have tried
to locate the faulty code and are now turning too this forum for any advice
or pointers where we are going wrong. (It might be worth mentioning that
this code has worked for us previously using the Servicemix-JMS-Component
which we have tried adapting in the camel approach.)

Our setup is as follows:

<camelContext id="camel"

<bean id="ibmmq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="">
<property name="transportType">
<util:constant staticfield=""/> 
<property name="queueManager" value="QMgr"/>
<property name="hostName" value=""/>     
<property name="port" value="1414"/>

<bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://" />
public class MyRouteBuilder extends RouteBuilder {

public void configure() {
from("").process(new Processor() {
public void process(Exchange exchange) throws Exception {
JmsMessage inMsg = null;

if (exchange.getIn() instanceof JmsMessage) {
inMsg = (JmsMessage)exchange.getIn();
javax.jms.Message inMsgMsg = inMsg.getJmsMessage();

if (inMsgMsg instanceof ActiveMQTextMessage) {
ActiveMQTextMessage inTextMsg = (ActiveMQTextMessage)inMsgMsg;
inMsgMsg.setStringProperty("JMS_IBM_Format", MQC.MQFMT_STRING);
inMsgMsg.setIntProperty("JMS_IBM_MsgType", MQC.MQMT_REQUEST);
else {
System.out.println("inMsgMsg not a ActiveMQTextMessage but a " +

else {
System.out.println("inMsg not a JmsMessage but a " +



A search through forums provided some related clues what might be a problem
in this case???

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message