Java Reference
In-Depth Information
<bean id="messageListener"
class="com.apress.einsure.report.async.messagelistener.ReportMessageListener" />
<!-- this is the Message Driven POJO (MDP) -->
<bean id="messageListener"
class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<constructor-arg>
<bean class=" com.apress.einsure.report.async.messagelistener. å
ReportMessageListener "/>
</constructor-arg>
</bean>
<!-- and this is the message listener container -->
<bean id="jmsContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="qConnectionFactory"/>
<property name="destination" ref="qReport"/>
<property name="messageListener" ref="messageListener" />
</bean>
</beans>
Note that in this configuration you have enlisted the message listener adapter
with the container. This adapter knows how to execute the message-driven POJO.
DefaultMessageListenerContainer is the most widely used message listener container.
Consequences
Benefits
• You get robust support for asynchronous service processing both in the applica-
tion server and in the Spring IOC container.
• The clients that access the asynchronous services are easy to develop.
• Spring-based MDBs form the backbone for JMS-based integration with external
systems.
• Since the request is being processed asynchronously, the users are not blocked for
long-running tasks.
 
Search WWH ::




Custom Search