Announcement Announcement Module
No announcement yet.
Message Driven POJO/JBoss 7.1.1/JBossWorkManagerTaskExecutor Configuration Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Message Driven POJO/JBoss 7.1.1/JBossWorkManagerTaskExecutor Configuration

    Hi All:

    I have setup a Spring (version 3.2.0) Message Driven POJO (MDP) inside JBoss (7.1.1.Final) as below.

            <jee:jndi-lookup id="connectionFactory" jndi-name="java:/JmsXA"
    		lookup-on-startup="true" /> <!-- proxy-interface="javax.jms.ConnectionFactory" -->
    	<jee:jndi-lookup id="testQueue" jndi-name="java:/queue/test"
    		lookup-on-startup="true" /> <!-- proxy-interface="javax.jms.Queue" -->
    	<!-- this is the Message Driven POJO (MDP) -->
    	<bean id="messageListener" class="">
    		<property name="realTimeQuoteService" ref="quoteServiceBean" />
    		<property name="stockQuoteCache" ref="stockQuoteCache" />
    		<property name="stockQuoteDAO" ref="stockQuoteDAO" />
    	<!-- and this is the message listener container -->
    	<bean id="jmsContainer"
    		<property name="connectionFactory" ref="connectionFactory" />
    		<property name="destination" ref="testQueue" />
    		<property name="messageListener" ref="messageListener" />
    This is working. The problem is, this setup has no concurrency. So for example, if I drop 10 messages on the queue, only one MDP will service all 10 messages, one after the other. Reading the documentation, if I add this
    <property name="concurrentConsumers" value="10"/>
    to the "jmsContainer" bean above, I should see 10 concurrent MDPs available for execution at any time. In practice, I see the below startup execption in JBoss logs

    18:04:46,172 ERROR [org.hornetq.ra.HornetQRASessionFactoryImpl] (jmsContainer-2) Could not create session: javax.jms.IllegalStateException: Only allowed one session per connection. See the J2EE spec, e.g. J2EE1.4 Section 6.6
    	at org.hornetq.ra.HornetQRASessionFactoryImpl.allocateConnection(
    	at org.hornetq.ra.HornetQRASessionFactoryImpl.createSession(
    	at [spring-jms-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    	at org.springframework.jms.listener.DefaultMessageListenerContainer.access$1400( [spring-jms-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary( [spring-jms-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener( [spring-jms-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop( [spring-jms-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    	at org.springframework.jms.listener.DefaultMessageListenerContainer$ [spring-jms-3.2.0.RELEASE.jar:3.2.0.RELEASE]
    	at [rt.jar:1.6.0_26]
    Reading the documentation, it sounds like I need to setup a JBossWorkManagerTaskExecutor to achieve the concurrency. But I am not able to find any examples on how to set this up. So asking the gurus here, any help/pointers will be very appreciated.

    Thanks in advance!