connection.stop() is not the same as connection.close(), u need to call close() to close the underlying transport connection, stop just stops dispatch.
Thanks for the feedback on the support page, I fixed the links to the nabble forums, will be picked up on the nightly refresh. The irc link should be good: irc://irc.codehaus.org/activemq not sure bout the log though. On 24 November 2010 03:55, Brett Wooldridge <[email protected]> wrote: > Hey all, > > Before I ask my question, and not to get off on the wrong foot, but my first > attempts to find the answer were met with some difficulty that I did not > expect from a project as major as ActiveMQ. First, the links to the > discussion forums from the site are met with a HTTP ERROR: 410 > "This forum has been deleted." message. Second, the link to the irc > channel is met with a different by semantically same error (indicating > that the channel does not exist). If the only official support is through > this list, those links should be deleted. > > Now my question... > > I have a consumer that is connected to an embedded broker. The Connection > has a registered exception listener. When I shutdown the system (and the > broker), despite my attempts to shutdown everything cleanly, the exception > listener is called. > > The connection setup looks like this: > > // Create a Connection > > ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory( > "vm://bridge"); > connection = connectionFactory.createConnection(); > > connection.setExceptionListener(this); > > connection.start(); > > > session = connection.createSession(false /* transacted */, Session. > AUTO_ACKNOWLEDGE); > > topic = session.createTopic("bridge"); > > consumer = session.createConsumer(topic); > > consumer.setMessageListener(this); > > > And shutdown looks like this: > > > consumer.close(); > > session.close(); > > connection.stop(); > > > After this, the broker is shutdown: > > > broker.stop(); > > broker.waitUntilStopped(); > > > At this point, the consumer's onException() is called, and a printing > > of the JmsException looks like: > > > javax.jms.JMSException: Peer (vm://bridge#0) disposed. > > > Given that the consumer and session where closed, and the connection was > > stopped (without exception) before the broker was stopped, I would not > > expect any callbacks to the consumer. > > > Via breakpoints I have verified that the order of things shutting down are > > correct (and as listed above). > > > Is there something that I'm missing? > > > Thanks in advance, > > Brett > -- http://blog.garytully.com http://fusesource.com
