users@glassfish.java.net

EndpointExceptionRedeliveryAttempts ignored ; why?

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Dec 2007 15:23:11 PST

I’m using Sun Java System Application Server 9.1 (build b58g-fcs) downloaded off the Glassfish web site.

Despite having EndpointExceptionRedeliveryAttempts, EndpointExceptionRedeliveryInterval, and SendUndeliverableMsgsToDMQ values set, calling setRollbackOnly() fails to take my message and throw the message into the dmq.

After calling setRollbackOnly 3 times, shouldn’t the message be thrown into the dmq using the code/configuration below?

My Glassfish debug log (FINER) indicates that my configuration is being read.

[b]MDB:[/b]
    public void onMessage(Message message)
    {
        // Always punt.
        
        String id = null;
        try
        {
            id = message.getJMSMessageID();
        }
        catch (JMSException ex)
        {
        }
        
        mdc.setRollbackOnly();
    }

This is my configuration:

[b]ejb-jar.xml[/b]
    <message-driven>
      <ejb-name>HubToFabSan01ReceiverMDBean</ejb-name>
      <ejb-class>com.ilmn.dam.fab.jms.HubToFabReceiverMDBean</ejb-class>
      <messaging-type>javax.jms.MessageListener</messaging-type>
      <transaction-type>Container</transaction-type> <!-- CMT -->
      <message-destination-type>javax.jms.Queue</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-property>
             <activation-config-property-name>destinationType</activation-config-property-name>
             <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
           </activation-config-property>

           <activation-config-property>
             <activation-config-property-name>EndpointExceptionRedeliveryAttempts</activation-config-property-name>
             <activation-config-property-value>3</activation-config-property-value>
           </activation-config-property>
           
           <activation-config-property>
             <activation-config-property-name>sendUndeliverableMsgsToDMQ</activation-config-property-name>
             <activation-config-property-value>true</activation-config-property-value>
           </activation-config-property>

           <!-- error handling -->

           <activation-config-property>
             <activation-config-property-name>RedeliveryAttempts</activation-config-property-name>
             <activation-config-property-value>3</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>
             <activation-config-property-name>RedeliveryInterval</activation-config-property-name>
             <activation-config-property-value>10</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>
             <activation-config-property-name>SendBadMessagesToDMD</activation-config-property-name>
             <activation-config-property-value>true</activation-config-property-value>
           </activation-config-property>
        </activation-config>
      
      <!-- The Linx host and port that JMS messages received by this MDB are posted to -->
      
      <env-entry>
        <env-entry-name>linxHostOverride</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value>localhost</env-entry-value>
      </env-entry>
      <env-entry>
        <env-entry-name>linxPortOverride</env-entry-name>
        <env-entry-type>java.lang.Integer</env-entry-type>
        <env-entry-value>8080</env-entry-value>
      </env-entry>

   </message-driven>

....
   <assembly-descriptor>
     <container-transaction>
       <method>
         <ejb-name>HubToFabSan01ReceiverMDBean</ejb-name>
           <method-name>onMessage()</method-name>
         </method>
       <trans-attribute>Required</trans-attribute>
     </container-transaction>
   </assembly-descriptor>

[b]sun-ejb-jar.xml[/b]
    <ejb>
      <ejb-name>HubToFabSan01ReceiverMDBean</ejb-name>
      <jndi-name>jms/HubToFabSan01Queue</jndi-name>
      <mdb-connection-factory>
        <jndi-name>jms/HubToFabSan01Factory</jndi-name>
      </mdb-connection-factory>
      <mdb-resource-adapter>
        <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-property>
             <activation-config-property-name>destinationType</activation-config-property-name>
             <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
           </activation-config-property>

           <!-- error handling -->

           <activation-config-property>
             <activation-config-property-name>EndpointExceptionRedeliveryAttempts</activation-config-property-name>
             <activation-config-property-value>3</activation-config-property-value>
           </activation-config-property>
           
           <activation-config-property>
             <activation-config-property-name>sendUndeliverableMsgsToDMQ</activation-config-property-name>
             <activation-config-property-value>true</activation-config-property-value>
           </activation-config-property>
           
           <activation-config-property>
             <activation-config-property-name>RedeliveryAttempts</activation-config-property-name>
             <activation-config-property-value>3</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>
             <activation-config-property-name>RedeliveryInterval</activation-config-property-name>
             <activation-config-property-value>10</activation-config-property-value>
           </activation-config-property>
           <activation-config-property>
             <activation-config-property-name>SendBadMessagesToDMD</activation-config-property-name>
             <activation-config-property-value>true</activation-config-property-value>
           </activation-config-property>
        </activation-config>
      </mdb-resource-adapter>
  </ejb>


[b]The control panel EndpointExceptionRedeliveryAttempts, EndpointExceptionRedeliveryInterval, SendUndeliverableMsgsToDMQ, and AddressList are set.[/b]
 
[b]In the logs I see:[/b][#|2007-12-07T13:50:24.660-0800|FINER|sun-appserver9.1|javax.resourceadapter.mqjmsra.inbound.message|_ThreadID=53;_ThreadName=p: thread-pool-1; w: 31;ClassName=com.sun.messaging.jms.ra.ResourceAdapter;MethodName=endpointDeactivation();FabEnterpriseApplication::HubToFabSan01ReceiverMDBean;ActvationSpec configuration=
       DestinationType =javax.jms.Queue
       Destination =HubToFabSan01Queue
       MessageSelector =null
       AcknowledgeMode =Auto-acknowledge
       SubscriptionDurability =NonDurable
       ClientId =null
       SubscriptionName =null
       EndpointPoolMaxSize =32
       EndpointPoolSteadySize =0
       EndpointPoolResizeCount =8
       EndpointPoolResizeTimeout =600
       EndpointExceptionRedeliveryAttempts =3
       EndpointExceptionRedeliveryInterval =15
       SendUndeliverableMsgsToDMQ =true
       GroupName =null
       RAUID =null
       InClusteredContainer =false
       MdbName =null
       UserName =null
       AddressList (in effect) =ilmnsd-hublim01
;_RequestID=872b191f-f94a-4244-8fea-de6d2c7bad09;|ENTRY FabEnterpriseApplication::HubToFabSan01ReceiverMDBean ActvationSpec configuration=
       DestinationType =javax.jms.Queue
       Destination =HubToFabSan01Queue
       MessageSelector =null
       AcknowledgeMode =Auto-acknowledge
       SubscriptionDurability =NonDurable
       ClientId =null
       SubscriptionName =null
       EndpointPoolMaxSize =32
       EndpointPoolSteadySize =0
       EndpointPoolResizeCount =8
       EndpointPoolResizeTimeout =600
       EndpointExceptionRedeliveryAttempts =3
       EndpointExceptionRedeliveryInterval =15
       SendUndeliverableMsgsToDMQ =true
       GroupName =null
       RAUID =null
       InClusteredContainer =false
       MdbName =null
       UserName =null
       AddressList (in effect) =ilmnsd-hublim01
|#]

But the message just keeps getting redelivered:
ENTRY 15
ENTRY true
ENTRY null
ENTRY 3
ENTRY 15
ENTRY true
ENTRY null
ENTRY 3
ENTRY 15
ENTRY true
ENTRY null
ENTRY 3
ENTRY 15
ENTRY true
ENTRY null
ENTRY 3
ENTRY 15
ENTRY true
[Message sent by forum member 'frenchdrip' (frenchdrip)]

http://forums.java.net/jive/thread.jspa?messageID=249141