[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: rolled back messages delivered twice.

timfox do-not-reply at jboss.com
Fri Feb 27 05:32:58 EST 2009


What I meant is, you said that you enlist the transaction *before* onMessage is called.

Here is the code in JBM that calls onMessage in JMSMessageListenerWrapper:


  |  try
  |       {         
  |          listener.onMessage(jbm);
  |       }
  |       catch (RuntimeException e)
  |       {
  |          //See JMS 1.1 spec, section 4.5.2
  |          
  |          log.warn("Unhandled exception thrown from onMessage", e);
  |          
  |          if (!transactedOrClientAck)
  |          {            
  |             try
  |             {                              
  |                session.getCoreSession().rollback(true);
  |                
  |                session.setRecoverCalled(true);
  |             }
  |             catch (Exception e2)
  |             {
  |                log.error("Failed to recover session", e2);
  |             }
  |          }
  |       }    
  | 

So in order to do enlistment before and after onMessage is called, you'd have to change that code, which you don't have access to in JCA.

So I don't understand how you can do the order that you specified.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213658#4213658

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213658



More information about the jboss-dev-forums mailing list