camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: Bridging the ActiveMQ with IBM Websphere using Camel
Date Wed, 24 Sep 2008 11:41:50 GMT
Hi

Can you use Hermes to browse the MQ queues? Maybe the MQ queue browser is showing it as a
raw kinda format. I am not familiar with the MQ console.

At my current client we have with success setup Hermes to browse our MQ broker.


I think you need some Java code in between your routing to be able to set the IBM specific
headers and other stuff that you need in your case to send it to your MQ.

So the route: from(activemq:queue.in).to(ibmmq:queue///queue.out)
Must be expanded with a processor to do the java coding needed.



You can do this route to let you be in control what is sent to MQ
from(activemq:queue.in).process(new Processor()) {
  public void process(Exchange exchange) {
    // TODO: Insert java code here
    exchange.getIn().setBody("Hello World");
    exchange.getIn().setHeaders(Collections.EMPTY_MAP);
};).to(ibmmq:queue///queue.out)



You can also remove the .to(ibmmq:queue///queue.out) in the route and send it manually from
the processor in java code. Here you can send it using spring-jms, so you can avoid whatever
Camel interferes with.

Bottom line: I will try to get some plain java code working that can send a message to MQ.
And then later use that code in Camel.


If you ping my en email at: davsclaus@apache.org then I will be able to send you some sample
java code that we use for sending message to MQ using spring-jms. Albeit we don't use this
in production, we are using it for proof-of-concept.

The same code can be used in Camel, just in the processor or as a spring bean etc.


 


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: JavaRat [mailto:fredrik.sassenberg@mindwell.se] 
Sent: 24. september 2008 13:26
To: camel-user@activemq.apache.org
Subject: RE: Bridging the ActiveMQ with IBM Websphere using Camel


Hi Claus, many thanks for your ideas and suggestions so far!

We have tested the above tips you had. Both on their own and together
without any effect we can see on the message which ends up on our final
queue destination. Browsing the message we get on the IBM MQ queue we get
the following:


XQH .... CAMELoutputchannel
                                  queue.out

            CT ....................ÿÿÿÿ....
....R...MQHRF2 .............AMQ Qmgr
            <<exH ...$.....................
......................

                                        Qmgr

                      CAMELusertester...'
Vu%%._IneiZ..................
                               .........WebS
phere MQ Client for Java20080924 
11025671    RFH .........................
MQSTR   ........,...........,<mcd><Msd>
jms_text</Msd><Type></Type></mcd>
...X<jms><Dst>queue:///queue.out</Dst>
<Tms>1222311223456</Tms><Cid></Cid>
<Dlv>2</Dlv></jms> ......
<usr><jms_IBM_MsgType dt='i4'>1</jms_IBM_MsgType>
<jms_IBM_Format>MQSTR</jms_IBM_Format>
</usr>
my chocolatechip cookie recipie


Without getting into MQ details it looks very much as we have a JMSMessage
around the TextMessage which we are intending to put onto the queue. (Clues
too why we think so is we see a MQHRF2 and a RFH part.) Also we see the
MQSTR and <Msd>jms_text</Msd> beeing recognized.
 
Our current guess (and let us assume this is the case) is that we are not
"peeling" off the camelWrapper Message before putting it onto the IBM MQ
queue. 
How can we avoid sending our textMessage inside this camelWrapperMessage?

Have we made a misstake thinking we can use the following configuration
inside the camel-context.xml?
We refer to this bean when we use the
from(activemq:queue.in).to(ibmmq:queue///queue.out)

<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="MW01"/>
<property name="hostName" value="172.23.1.19"/>     
<property name="port" value="1414"/>
</bean>
		</property> 
	</bean>
-- 
View this message in context: http://www.nabble.com/Bridging-the-ActiveMQ-with-IBM-Websphere-using-Camel-tp19623329s22882p19646763.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message