1 Reply Latest reply on Apr 26, 2004 5:18 PM by Adrian Brock

    No container-transaction in ejb-jar.xml -> no DLQ

    Kabir Khan Master

      I have been working on an MDB. My ejb-jar.xml is shown below. With this configuration, the bean deploys fine and works for successful calls, but failed messages are never retried (i.e. MDB is just invoked once with the message) and never end up on the DLQ.

      <ejb-jar>
       <enterprise-beans>
       <message-driven>
       <ejb-name>RemoteDeliveryMessageDrivenBean</ejb-name>
       <ejb-class>org.jboss.mail.mailhandler.remote.RemoteDeliveryMessageDrivenBean</ejb-class>
       <transaction-type>Container</transaction-type>
       <message-driven-destination>
       <destination-type>javax.jms.Queue</destination-type>
       </message-driven-destination>
       <env-entry>
       <env-entry-name>MailListenerService</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>jboss.mail:type=MailServices,name=MailListener</env-entry-value>
       </env-entry>
       <env-entry>
       <env-entry-name>DeliveryService</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>jboss.mail:name=SMTPSender,type=MailServices</env-entry-value>
       </env-entry>
       </message-driven>
       </enterprise-beans>
      
      </ejb-jar>
      



      Once I added the container-transaction stuff for the bean it works as expected:

      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
      <ejb-jar>
       <enterprise-beans>
       <message-driven>
       <ejb-name>RemoteDeliveryMessageDrivenBean</ejb-name>
       <ejb-class>org.jboss.mail.mailhandler.remote.RemoteDeliveryMessageDrivenBean</ejb-class>
       <transaction-type>Container</transaction-type>
       <message-driven-destination>
       <destination-type>javax.jms.Queue</destination-type>
       </message-driven-destination>
       <env-entry>
       <env-entry-name>MailListenerService</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>jboss.mail:type=MailServices,name=MailListener</env-entry-value>
       </env-entry>
       <env-entry>
       <env-entry-name>DeliveryService</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>jboss.mail:name=SMTPSender,type=MailServices</env-entry-value>
       </env-entry>
       </message-driven>
       </enterprise-beans>
       <!-- Without this bit the message never seems to get retried and never ends up on on the DLQ -->
       <assembly-descriptor>
       <container-transaction>
       <method>
       <ejb-name>RemoteDeliveryMessageDrivenBean</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       </assembly-descriptor>
      
      </ejb-jar>
      


      Not sure if this is a (known) bug or not. I did a quick search on the forums, and couldn't find anything about it, so thought I'd mention it anyway.