Thank you for your reply once again Claus!

We have been researching the pointers you gave us.
After some experimenting we found a few interesting things with camel. This
is what we think is happening in camel and our problem (we attach another
sketchy picture what we think is happening):

http://www.nabble.com/file/p19643280/camelencapsulation.jpeg
camelencapsulation.jpeg 

1.

Question: The payload is missing on the message put onto the final
destinationqueue?!

Probable cause: While trying out the MyRouterBuilder.java with the following
code we left an old fashion system.println.out in the code:
 
from(activemq:queue.in)..process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("camelInMsg = " +exchange.getIn().toString());
}})
.to("ibmmq:queue:///queue.out");

    
We belive by doing exchange.getIn() you actually take the message “off the
queue” and if not setting the exchange.setIn() afterwards you will end up
with an empty message? (Removing the system.out.println and you get your
original message on the finalqueue as we want)


2.

Question: When picking a message off the Active MQ queue it seems that Camel
“wraps it in an own “Messagewrapper” called
org.apache.camel.component.jms.JMSMessage.
How will we reach the “real message we need to access and enrich?”?!

What we have tried:
We attempt too dig into the original message by peeling off the
camelshellmessage using some cast like:
JMSMessage camelWrapMessage =  (JMSMessage)exchange.getIn();
ActiveMQTextMessage myInnerTextMessage =
(ActiveMQTextMessage)camelWrapMessage;

Now the original message seems to be accessable for adding additional
information as in our case were we want to put a few IBMMQ specific
properties such as for example
myInnerTextMessage.setStringProperty(JMS_IBM_Format”, MQC.MQFMT_STRING); and 
myInnerTextMessage.JMSReplyTo(responseQueue);
However here is an interesting feature when we use
myInnerTextMessage.setStringProperty(“jms_IBM_Format”, MQC.MQFMT_STRING);
camel will not think it is a specific JMS property and accept it as a custom
header. (So be mindful when using capital letters.)

After this is done we can now what we believe is the actual message put onto
the next queue with first camelWrapMessage.setJMSMessage(myInnerTextMsg);
exchange.setIn(camelWrapMessage);

So far so good…

However when we check the IBM MQ queue we find the message properties are
set what looks like a textmessage inside a JMSmessage ?!
Why do we have this at the end?

We are guessing here and this is where really could use some help:

We want ONLY the textMessage to be sent not the camelWrapMessage, this might
not be our problem though since we use:

<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 static-field="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>

in our camel-context.xml. But if we remove the 

<bean id="ibmmq" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">

…

</property> 
</bean>

we cannot seem to get it too connect to our IBM MQ queue?

Question 3: How do we remove what looks like the extra enwrapped JMSMessage
and only send our original TextMessage to the final queue?

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

Reply via email to