View Full Version : JMS Gateway help needed
Jul 22nd, 2008, 10:07 AM
I saw a thread in the archives about JMS Gateway. I have similarly set up a jms-gateway within my configuration. I'm trying to read off an ActiveMQ queue and pass the message onto an SI message channel. However, I find that all the code comes alive, but the message just isn't picked off the queue. lil' help?
I'm using the M4 release of Spring Integration.
snippets of config:
<bean id="inboundJMSFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
Jul 23rd, 2008, 08:39 AM
Ok, scratch this. Moving over to M5 seemed to do the trick. Actually I seem to remember another fix being put in that last thread I was reading so this is my bad.
One thing to note here though (that I struggled with annoyingly) is that handler-endpoint has been changed again. handler-ref is not longer there. it's just ref now!
One thing that would really help is an xml configuration breakdown & explanation.
Jul 23rd, 2008, 11:17 AM
I can't seem to get the gateway to process 2 messages at once.
I've just taken a look at the code and it seems that the concurrent consumers is set to 1 and cannot be changed.
Am I missing some configuration that allows this?
Jul 23rd, 2008, 11:40 AM
Currently, the only way to provide such configuration for the MessageListener container used by the gateway is to define the container separately and then provide it to the setContainer() method of JmsGateway. However, please feel free to open an issue for enabling this.
Jul 23rd, 2008, 11:42 AM
I also wanted to provide a quick reply to your other comments above. These changes felt necessary as we're working through the milestones trying to achieve the best and most intuitive model. Hopefully the ultimate result will be more than worth the inconveniences now, and the documentation will be enhanced significantly for the "Release Candidate" versions.
Here's some of the rationale behind the changes that hopefully puts them into perspective...
The <handler-endpoint/> element seemed too generic and also introduced a Spring Integration internal implementation detail to the terminology. On the other hand <service-activator/> is the EIP name and hence very well documented. This is the same reason that we changed both <source-endpoint/> and <target-endpoint/> to <channel-adapter/>.
The 'handler-ref' attribute was originally added when there was also an option of using a <handler/> sub-element. This was consistent with other Spring namespace support where the x-ref naming is used for a simple attribute alternative to using a sub-element. However, the plain 'ref' attribute now provides more consistency within Spring Integration (also used with <router/>, <splitter/> etc.) and also with other Spring usage - for example, the Spring JMS namespace: <jms:listener ref="x" method="y"/>.
I hope the changes make sense in that light, and thanks for the feedback.
Jul 23rd, 2008, 12:04 PM
Thanks Mark - I think that all makes sense (I read a few JIRA from Dave Syer too on that).
I've raised a JIRA on the concurrent consumer thing - http://jira.springframework.org/browse/INT-313
Jul 29th, 2008, 06:42 PM
The concurrency attributes (as well as maxMessagesPerTask and idleTaskExecutionLimit) can now all be configured as attributes on the <jms-gateway/> element. Please see the JIRA issue for more info.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.