camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JavaRat <fredrik.sassenb...@mindwell.se>
Subject Bridging the ActiveMQ with IBM Websphere using Camel
Date Tue, 23 Sep 2008 08:28:47 GMT

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).

http://www.nabble.com/file/p19623329/camelissue.jpeg 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
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
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<package>org.websitename</package>
</camelContext>

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

<bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://127.0.0.1:61616" />
</bean>
</property> 
</bean>

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/Some-headers-are-not-forwarded-to-JMS-destinations-td16763376s22882.html#a16763376

http://www.nabble.com/How-to-avoid-to-lost-Headers-add-from-messages-go-from-activemq---td18381854s22882.html#a18381854

http://www.nabble.com/-CONF--Apache-Camel:-Bean-Binding-(page-edited)-td18903933s22882.html

-- 
View this message in context: http://www.nabble.com/Bridging-the-ActiveMQ-with-IBM-Websphere-using-Camel-tp19623329s22882p19623329.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message