[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: JBMESSAGING-126 -- JMS expiration

weston.price@jboss.com do-not-reply at jboss.com
Fri Nov 17 12:57:55 EST 2006


Callchain:

AsfAspect.handleRun()->MessageCallbackHandler.callOnMessage()->JmsServerSession().onMessage()->MDB.onMessage()

Exception is thrown from MDB which is caught in the following code in the JMSServerSesssion


  | 
  |    public void onMessage(Message message)
  |    {
  |       try
  |       {
  |          endpoint.beforeDelivery(JmsActivation.ONMESSAGE);
  |     
  |          try
  |          {
  |             if (dlqHandler == null || dlqHandler.handleRedeliveredMessage(message) == false)
  |             {
  |                MessageListener listener = (MessageListener)endpoint;
  |               
  | 
  |               listener.onMessage(message);
  |             }
  |          }
  |          finally
  |          {
  |             endpoint.afterDelivery();
  |             
  |             if (dlqHandler != null)
  |                dlqHandler.messageDelivered(message);
  |          }
  |       }
  | 
  |       catch (Throwable t)
  |       {
  |          //MDB RUNTIME EXCEPTION HANDLED HERE!
  |          log.error("Unexpected error delivering message " + message, t);
  |          
  |          if(txnStrategy != null)
  |             txnStrategy.error();
  |          
  |       }
  |       
  |    
  |    }
  | 

So, the exception never makes it back to the MessageCallbackHandler. So the code


  | 
  |  if (trace) { log.trace("calling listener's onMessage(" + m + ")"); }
  | 
  |             listener.onMessage(m);
  | 
  |             if (trace) { log.trace("listener's onMessage() finished"); }
  |             
  |             break;
  | 
  | 

executes with no issues. 




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

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



More information about the jboss-dev-forums mailing list