Community

Configuring Message Driven Beans

created by Tuan Nguyen in Beginner's Corner - View the full discussion

To configure the MDB (message driven beans) to accept message, do I use ejb-jar.xml or jboss.xml to connect the MDB class to the jndi queue as such:

 

jboss.xml:

 

<jboss> 
    <enterprise-beans> 
        <message-driven> 
            <ejb-name>SimpleMessageBean</ejb-name> 
            <destination-jndi-name>queue/MyQueue</destination-jndi-name> 
        </message-driven> 
    </enterprise-beans> 
</jboss> 

 

or ejb-jar.xml:

 

<message-driven>
     <ejb-name>ExampleMDB</ejb-name>
     <ejb-class>org.jboss.tutorial.mdb_deployment_descriptor.bean.SimpleMessageBean</ejb-class>
     <transaction-type>Bean</transaction-type>
     <message-destination-type>javax.jms.MyQueue</message-destination-type>
   <activation-config>
      <activation-config-property>
           <activation-config-property-name>acknowledgeMode</activation-config-property-name>
           <activation-config-property-value>AUTO_ACKNOWLEDGE</activation-config-property-value>
      </activation-config-property>
    </activation-config>

</message-driven>
Thanks,

Tuan

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community