Announcement Announcement Module
Collapse
No announcement yet.
Configuring queue in jboss-web.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring queue in jboss-web.xml

    This is my applicationcontext.xml for spring DI:

    <bean id="queueA" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="queue/QueueA"/>
    </bean>

    <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name ="connectionFactory" ref="jmsQueueConnectionFactory"/>
    <property name ="defaultDestination" ref="queueA"/>
    </bean>

    <bean id="someClass" class="SomeClass">
    <property name="jmsTemplate" ref="jmsTemplate"/>
    </bean>

    <!-- Configuring the Listener -->
    <!-- this is the Message Driven POJO (MDP) -->
    <bean id="messageListener" class="QueueAMDB"/>

    <!-- and this is the message listener container -->
    <bean id="messageListenerContainer"
    class="org.springframework.jms.listener.DefaultMes sageListenerContainer">
    <property name="connectionFactory" ref="jmsQueueConnectionFactory" />
    <property name="destination" ref="queueA" />
    <property name="messageListener" ref="messageListener" />
    </bean>


    Now, I am trying to set up the queue in jboss-web.xml. If my SomeClass.class just implements MessageListener,and doesnt implemnet MessageDrivenBean. If it were a MDB, my config in jboss to map to jndi would be:

    <message-driven>
    <ejb-name>SomeClass</ejb-name>
    <destination-jndi-name>queue/QueueA</destination-jndi-name>
    <resource-ref>
    <res-ref-name>jms/test/TestQueue</res-ref-name>
    <jndi-name>ConnectionFactory</jndi-name>
    </resource-ref>
    </message-driven>

    and in my ejb-jar.xml, it would be:

    <message-driven>
    <ejb-name>SomeClass</ejb-name>
    <ejb-class>SomeClass</ejb-class>
    <transaction-type>Container</transaction-type>
    <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
    <message-driven-destination>
    <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>

    <resource-ref>
    <res-ref-name>jms/test/TestQueue</res-ref-name>
    <res-type>javax.jms.QueueConnectionFactory</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </message-driven>

    Anyone would bother guiding me how to configure my SomeClass MDP when it implements just a listener?
Working...
X