Thanks Gary. After turning on log output, I found that ActiveMQ's shutdown hook was enabled by default. So it can close itself down whenever the host application simply exited. No worry for now. :)
Gary Tully wrote: > > add an id attribute to the amq:broker bean and get a handle on the > bean using your spring context, then call shutdown on it. > > for logging, see: > http://activemq.apache.org/how-can-i-enable-detailed-logging.html > > 2008/11/4 hanson2010 <[EMAIL PROTECTED]>: >> >> Spring context configuration is as below... Now my pain is I can start up >> the >> broker with the application. But after captured Ctrl+C, the application >> exits promptly. So I want to do this more gracefully to shut it down. >> >> BTW, how can I switch on log output of the broker. >> >> <amq:broker useJmx="false" useShutdownHook="true" >> persistent="true" >> dataDirectory="./data"> >> <amq:persistenceAdapter> >> <amq:amqPersistenceAdapter syncOnWrite="false" >> directory="./data" maxFileLength="32 mb" >> /> >> </amq:persistenceAdapter> >> <amq:transportConnectors> >> <amq:transportConnector >> uri="tcp://localhost:${amq.port}" /> >> </amq:transportConnectors> >> </amq:broker> >> >> <amq:queue id="destination" physicalName="${amq.queue}" /> >> >> <amq:connectionFactory id="jmsConnectionFactory" >> brokerURL="vm://localhost" /> >> -- >> View this message in context: >> http://www.nabble.com/Shut-down-an-embedded-broker-defined-in-Spring-context-tp20316945p20316945.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Shut-down-an-embedded-broker-defined-in-Spring-context-tp20316945p20355336.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.