activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abdoulzak <abdoul...@gmail.com>
Subject ActiveMQ and Java Shudown Hook
Date Mon, 26 May 2008 18:30:33 GMT

Hi,
I have JMS client (daemon) witch implements MessageListener and
ExceptionListener when an exception caught  the  client stopped by calling
the shutdown method. I do nothing in onException() just logging.
here is the shutdown method : 

 private static void addDaemonShutdownHook()
   {
      Runtime.getRuntime().addShutdownHook(new Thread()
         {
            public void run()
            {
               ConsumerFacade.shutdown();
            }
         });
   }

Shutdown :

public static void shutdown()
   {
      try
      {
         consumer.stop();
         log.info("Shutdown completed.");
      }
      catch (Exception e)
      {
         log.error("Exception while waiting consumer to stop.");
       
      }
   }

I use ActiveMQ 5.1.0, but if I change the version to 5.0.0 i did not have
the same problem; it work perfectly.	 	

Have you any idea?

-- 
View this message in context: http://www.nabble.com/ActiveMQ-and-Java-Shudown-Hook-tp17476962s2354p17476962.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message