You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Rob Davies <ra...@gmail.com> on 2007/10/09 13:02:42 UTC
Shutdown hook in ActiveMQ
I've found that the our use of the shutdown hook in the Broker to
cause some problems - especially debugging - its difficult to kill
the broker ;)
Is anybody else having problems with it?
cheers,
Rob
http://rajdavies.blogspot.com/
Re: Shutdown hook in ActiveMQ
Posted by Bruce Snyder <br...@gmail.com>.
On 10/9/07, James Strachan <ja...@gmail.com> wrote:
> Rob was talking about debugging; so I presumed the thread was about
> using test cases and so forth; in which case, there's no need to use
> the shutdown handler as the JUnit test case can stop the broker (and
> typically JUnit terminates the JVM anyway on exit).
My mistake then. I wasn't necessarily focused on only debugging.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/
Re: Shutdown hook in ActiveMQ
Posted by James Strachan <ja...@gmail.com>.
On 09/10/2007, Bruce Snyder <br...@gmail.com> wrote:
> On 10/9/07, James Strachan <ja...@gmail.com> wrote:
> > You could always just disable the use of the shutdown handler on the
> > BrokerServer
> > http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html#setUseShutdownHook(boolean)
> >
> > or <broker> element
> > http://activemq.apache.org/maven/activemq-core/xsddoc/http___activemq.org_config_1.0/element/broker.html
>
> I don't think this is a good idea as it means that nothing gets
> cleanly unregistered and stopped.
Rob was talking about debugging; so I presumed the thread was about
using test cases and so forth; in which case, there's no need to use
the shutdown handler as the JUnit test case can stop the broker (and
typically JUnit terminates the JVM anyway on exit).
FWIW running the shutdown handler is gonna close things down cleaner
for sure - but given ActiveMQ has to handle boxes just dying at
runtime, things should still work without the shutdown handler (i.e.
no message loss or corruption of the database etc).
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: Shutdown hook in ActiveMQ
Posted by Bruce Snyder <br...@gmail.com>.
On 10/9/07, James Strachan <ja...@gmail.com> wrote:
> You could always just disable the use of the shutdown handler on the
> BrokerServer
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html#setUseShutdownHook(boolean)
>
> or <broker> element
> http://activemq.apache.org/maven/activemq-core/xsddoc/http___activemq.org_config_1.0/element/broker.html
I don't think this is a good idea as it means that nothing gets
cleanly unregistered and stopped.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/
Re: Shutdown hook in ActiveMQ
Posted by Rob Davies <ra...@gmail.com>.
sounds good to me!
On Oct 9, 2007, at 4:01 PM, James Strachan wrote:
> On 09/10/2007, Hiram Chirino <hi...@hiramchirino.com> wrote:
>> Hey rob.. we could just change our shutdown hook processing so
>> that it
>> closes down the message store. Stores can usually start up
>> quicker if
>> shutdown properly. We can avoid shutting down the transports since
>> that can take a while.
>
> Great idea - maybe we need a kinda stopQuickly() method on the
> BrokerService which just stops the persistence and tries really
> quickly (but not waiting) to stop the transports.
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
Re: Shutdown hook in ActiveMQ
Posted by James Strachan <ja...@gmail.com>.
On 09/10/2007, Hiram Chirino <hi...@hiramchirino.com> wrote:
> Hey rob.. we could just change our shutdown hook processing so that it
> closes down the message store. Stores can usually start up quicker if
> shutdown properly. We can avoid shutting down the transports since
> that can take a while.
Great idea - maybe we need a kinda stopQuickly() method on the
BrokerService which just stops the persistence and tries really
quickly (but not waiting) to stop the transports.
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: Shutdown hook in ActiveMQ
Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hey rob.. we could just change our shutdown hook processing so that it
closes down the message store. Stores can usually start up quicker if
shutdown properly. We can avoid shutting down the transports since
that can take a while.
Regards.
Hiram
On 10/9/07, Rob Davies <ra...@gmail.com> wrote:
> Yes - I'm actually using that ;) - depending on what people felt - I
> wondered about disabling the shutdown hook by default - as the
> shutdown hook should be short lived, we are limited in what we can do
> witthout running into problems.
> This isn't a big problem - just a nuisance
>
>
>
> cheers,
>
> Rob
>
> http://rajdavies.blogspot.com/
>
>
>
> On Oct 9, 2007, at 12:34 PM, James Strachan wrote:
>
> > You could always just disable the use of the shutdown handler on the
> > BrokerServer
> > http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/
> > activemq/broker/BrokerService.html#setUseShutdownHook(boolean)
> >
> > or <broker> element
> > http://activemq.apache.org/maven/activemq-core/xsddoc/
> > http___activemq.org_config_1.0/element/broker.html
> >
> >
> > On 09/10/2007, Bruce Snyder <br...@gmail.com> wrote:
> >> On 10/9/07, Rob Davies <ra...@gmail.com> wrote:
> >>> I've found that the our use of the shutdown hook in the Broker to
> >>> cause some problems - especially debugging - its difficult to kill
> >>> the broker ;)
> >>> Is anybody else having problems with it?
> >>
> >> Yes, I've experienced this myself and I am forced to resort to hard
> >> kill of the pid.
> >>
> >> Bruce
> >> --
> >> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D
> >> \!G;6%I;\"YC;VT*"
> >> );'
> >>
> >> Apache ActiveMQ - http://activemq.org/
> >> Apache ServiceMix - http://servicemix.org/
> >> Apache Geronimo - http://geronimo.apache.org/
> >> Castor - http://castor.org/
> >>
> >
> >
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> > Open Source SOA
> > http://open.iona.com
>
>
--
Regards,
Hiram
Blog: http://hiramchirino.com
Re: Shutdown hook in ActiveMQ
Posted by Rob Davies <ra...@gmail.com>.
Yes - I'm actually using that ;) - depending on what people felt - I
wondered about disabling the shutdown hook by default - as the
shutdown hook should be short lived, we are limited in what we can do
witthout running into problems.
This isn't a big problem - just a nuisance
cheers,
Rob
http://rajdavies.blogspot.com/
On Oct 9, 2007, at 12:34 PM, James Strachan wrote:
> You could always just disable the use of the shutdown handler on the
> BrokerServer
> http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/
> activemq/broker/BrokerService.html#setUseShutdownHook(boolean)
>
> or <broker> element
> http://activemq.apache.org/maven/activemq-core/xsddoc/
> http___activemq.org_config_1.0/element/broker.html
>
>
> On 09/10/2007, Bruce Snyder <br...@gmail.com> wrote:
>> On 10/9/07, Rob Davies <ra...@gmail.com> wrote:
>>> I've found that the our use of the shutdown hook in the Broker to
>>> cause some problems - especially debugging - its difficult to kill
>>> the broker ;)
>>> Is anybody else having problems with it?
>>
>> Yes, I've experienced this myself and I am forced to resort to hard
>> kill of the pid.
>>
>> Bruce
>> --
>> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D
>> \!G;6%I;\"YC;VT*"
>> );'
>>
>> Apache ActiveMQ - http://activemq.org/
>> Apache ServiceMix - http://servicemix.org/
>> Apache Geronimo - http://geronimo.apache.org/
>> Castor - http://castor.org/
>>
>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
Re: Shutdown hook in ActiveMQ
Posted by James Strachan <ja...@gmail.com>.
You could always just disable the use of the shutdown handler on the
BrokerServer
http://activemq.apache.org/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html#setUseShutdownHook(boolean)
or <broker> element
http://activemq.apache.org/maven/activemq-core/xsddoc/http___activemq.org_config_1.0/element/broker.html
On 09/10/2007, Bruce Snyder <br...@gmail.com> wrote:
> On 10/9/07, Rob Davies <ra...@gmail.com> wrote:
> > I've found that the our use of the shutdown hook in the Broker to
> > cause some problems - especially debugging - its difficult to kill
> > the broker ;)
> > Is anybody else having problems with it?
>
> Yes, I've experienced this myself and I am forced to resort to hard
> kill of the pid.
>
> Bruce
> --
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> Castor - http://castor.org/
>
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: Shutdown hook in ActiveMQ
Posted by Bruce Snyder <br...@gmail.com>.
On 10/9/07, Rob Davies <ra...@gmail.com> wrote:
> I've found that the our use of the shutdown hook in the Broker to
> cause some problems - especially debugging - its difficult to kill
> the broker ;)
> Is anybody else having problems with it?
Yes, I've experienced this myself and I am forced to resort to hard
kill of the pid.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/