[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Deadlock in JBoss Messaging during JBoss5 shutdown

timfox do-not-reply at jboss.com
Sat Oct 27 07:06:50 EDT 2007


Clebert - I'm not sure you're patch is correct.

Can't we just do:


  | 
  | 
ConsumerState consumerState = getState(invocation);
      
      ClientConsumer clientConsumer = consumerState.getClientConsumer();
      
      try
      {      
         // We make sure closing is called on the ServerConsumerEndpoint.
         // This returns us the last delivery id sent
   
         Long l  = (Long)invocation.invokeNext();
   
         long lastDeliveryId = l.longValue();
   
         // First we call close on the ClientConsumer which waits for onMessage invocations
         // to complete and the last delivery to arrive
         clientConsumer.close(lastDeliveryId);
   
        ...
        ...
   
         return l;
      }
      catch (Exception e)
      {
         if (!(e instanceof MessagingNetworkFailureException) &&
               !clientConsumer.isClosed())
         {
            //Make sure we close the client consumer - but we don't want to do this
            //in a failover situation
            clientConsumer.close(-1);
         }
         throw e;
      }


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

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



More information about the jboss-dev-forums mailing list