Bridging the ActiveMQ with IBM Websphere using Camel
davinci25 Sep 23, 2008 4:20 AMThe trend seem too be moving towards using the camel component in Servicemix version 4 and also as a standalone routingcomponent therefore we attempt to use it in our coming projects. However while trying to bridge an ActiveMQqueue with an IBM MQ websphere queue we have discovered the following problem (please see attached picture).
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 emptied???
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:
CAMEL-CONTEXT.xml
MyRouteBuilder.java
public class MyRouteBuilder extends RouteBuilder {
public void configure() {
from("activemq:queue.in").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;
inTextMsg.setReadOnlyProperties(false);
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 " + inMsgMsg.getClass().toString());
}
}
else {
System.out.println("inMsg not a JmsMessage but a " + exchange.getIn().getClass().toString());
}
.to("ibmmq:queue.out");
}
A search through forums provided some related clues what might be a problem in this case???
http://www.nabble.com/-CONF--Apache-Camel:-Bean-Binding-(page-edited)-td18903933s22882.html
-
camelissue.jpeg 14.3 KB