5 Replies Latest reply on Jun 18, 2010 1:17 PM by Tuan Nguyen

    Configuring Message Driven Beans

    Tuan Nguyen Newbie

      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