-
1. Re: CorrelationId and Camel
davsclaus Jul 30, 2010 7:26 AM (in response to philwaldron)Just set a header with JMSCorrelationID as the key on the Camel Message before its sent to the JMS endpoint.
-
2. Re: CorrelationId and Camel
philwaldron Jul 30, 2010 9:22 AM (in response to philwaldron)I have found camel out of box great with ActiveMQ but I am struggling with this weblogic connection.
I only use Spring and have no Java experience so my simple question HOW. There is no reference on the Web Site or Camel In Action.pdf, if there is just quote page number.
Thanks in advance for ur assistance
Phil
-
3. Re: CorrelationId and Camel
davsclaus Jul 30, 2010 10:11 AM (in response to philwaldron)You just use the setHeader DSL
<setHeader headerName="JMSCorrelationID"> <constant>123</constant> </setHeader>
Also check out the unit test of the jms component. For example this unit test
-
4. Re: CorrelationId and Camel
philwaldron Jul 30, 2010 10:43 AM (in response to philwaldron)I was looking for the most complicated solution, should have known with camel not to get the Hump.
Kind Regards
Phil
-
5. Re: CorrelationId and Camel
davsclaus Jul 30, 2010 10:46 AM (in response to philwaldron)Yeah some Camel end user put it like that. If the solution seems to be to complex or to hard, then usually there is an easier way with Camel.
If its still to hard, then speak up and we will make it easier. After all its the goal of Camel, to make your integration problems easier.
-
6. Re: CorrelationId and Camel
kannappan123 Apr 26, 2013 2:03 AM (in response to davsclaus)I have a problem with the Request Reply queue. I want to be able to drop a message on to the request queue and then pick up the corresponding reply from the reply queue. I am using IBM Websphere MQ.
My (Component / ArtifactId / URI) is like this
jms-mq:planRequestQueue?replyTo=planReplyQueue
I have set ExchangePattern to InOut
I can successfully drop a message on to planRequestQueue and receive the reply message on the planReplyQueue. However on the reply queue, the JMS connection (open input count) is NOT closed.
I have tried adding transactedInOut but that does not even connect to the reply queue
jms-mq:planRequestQueue?replyTo=planReplyQueue&transactedInOut=true
If I define them as 2 different routes how do I link them up with the correlation ID,
Any input would be greatly appreciated.
Edited by: kannappan123 on Apr 26, 2013 6:01 AM
-
7. Re: CorrelationId and Camel
davsclaus Apr 26, 2013 6:04 AM (in response to kannappan123)Why do you want the jms connection to close?
Its usually the a combination of CACHE_LEVEL and connection pooling that controls the open/close behavior. See details and options at
Such as
You can set the {{replyToCacheLevelName}} to NONE.
-
8. Re: CorrelationId and Camel
kannappan123 Apr 28, 2013 10:06 PM (in response to davsclaus)Once I have read the response from the request/reply queue I want the physical connection from the application to the websphere mq to be closed.
Currently it is not closed and as a result the "open input count" on websphere mq constantly goes up with every reply message.
The application reaches the maximum number of connections set to 100 on the connection pool setting for the queue connection factory and stalls. As it cannot grow more than 100 and the connections are not release back to to the connection pool. I have attached the screen shot of queue connection factory configuration on Webpshere application container and also a screen shot showing the number of open connections.
Edited by: kannappan123 on Apr 29, 2013 2:05 AM
Edited by: kannappan123 on Apr 29, 2013 2:06 AM
-
mqExplorer.jpg 131.8 KB
-
appserverConnectionPool.jpg 117.8 KB
-
-
9. Re: CorrelationId and Camel
davsclaus Apr 29, 2013 2:00 AM (in response to kannappan123)What version of Camel and WebSphere MQ are you using?
-
10. Re: CorrelationId and Camel
kannappan123 Apr 29, 2013 2:11 AM (in response to kannappan123)The camel version is 2.10.3 and websphere MQ 7.0.0.1
The connections does not seem to be closed even after setting replyToCacheLevelName to CACHE_NONE and cacheLevelName to CACHE_NONE
Edited by: kannappan123 on Apr 29, 2013 6:05 AM
-
11. Re: CorrelationId and Camel
davsclaus Apr 29, 2013 11:27 AM (in response to kannappan123)Well you may have a connection pool in use, that don't physically close connections, as it wants to reuse connections.
-
12. Re: CorrelationId and Camel
kannappan123 Apr 29, 2013 7:57 PM (in response to davsclaus)Hi Davsclaus,
That can't be, given that it closes the connection on the request (channel) queue, where the message produced by the java app is sent. The response is then received on the reply (Channel) queue.
My (Component / ArtifactId / URI) is like this :
jms-mq:instalmentPlanRequestQueue?replyTo=instalmentPlanReplyQueue&jmsMessageType=Text&useMessageIDAsCorrelationID=true
If you look at the previous screenshot, you will see that the number of open connections on the (Request) ITS.INS.DEV.INSTALMENTPLAN.REQ is 2. It goes up with every request but once the message is put in the channel it comes back down to 2.
Where as on the (Reply) ITS.INS.DEV.INSTALMENTPLAN.REPLY the open connections keep going up with every message received. The connection don't seem to be closed. This leads the MQ host to crash.
-
13. Re: CorrelationId and Camel
davsclaus Apr 30, 2013 1:29 AM (in response to kannappan123)Well its still all about how you configure the WebSphere MQ client / Camel JMS component.
There are WebSphere MQ users using Camel successfully with no problems.
-
14. Re: CorrelationId and Camel
kannappan123 Apr 30, 2013 2:40 AM (in response to davsclaus)Hi Claus Ibsen,
Yes I am one of them, I do have Camel WebSphere MQ client working very well with no connection leaks for sending messages to a queue and few for receiving messages from the queue.
However when I use the request/reply queue, that is I send (to request queue) and receive (from reply queue) using the same route is when I see the connection leaks on the reply queue only. The connections to request queue is all closed.
I have set the ExchangePattern set to InOut
I have tried adding the following JmsConfiguration properties.
but still not able to get the connection to close on the reply queue.
I have tried setting transactedInOut=true, but this sends the message to the request queue but does not connect to the reply queue.
I tried setting targetClient=1 but that does not even connect to the request queue
If try defining them as 2 separate routes I am not sure how I can link the request and reply messages, ideally using the CorrelationID, some how.
I am wondering if I am missing a configuration on the request/reply channel.
Any input on this would be greatly appreciated.
Regards
Kanna
Edited by: kannappan123 on Apr 30, 2013 6:38 AM