Spring Message-Driven POJOs
Submitted by rowell on Fri, 01/11/2008 - 14:18
This is probably one of my favorite features of Spring. This simple configuration will enable any method of any class to receive JMS messages asynchonously and send a response, if needed...
<bean id="echoBean" class="com.samples.Echo" />
<jms:listener-container
connection-factory="connectionFactory"
destination-type="queue"
concurrency="10">
<jms:listener destination="com.samples.queue" ref="echoBean" method="echo"/>
</jms:listener-container>
<jms:listener-container
connection-factory="connectionFactory"
destination-type="queue"
concurrency="10">
<jms:listener destination="com.samples.queue" ref="echoBean" method="echo"/>
</jms:listener-container>
If echo has a return type, it will automatically be converted to a JMS Message and sent to the destination specified in the JMSReplyTo attribute of the incoming message. Sweet!
Comments
Do you try to make your article about this good post really very fashionable with the assistance of the article submit service? If not, I would advice to determine the best article submission services! Hope that the suggestion would help!