activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Wooldridge <brett.wooldri...@gmail.com>
Subject ActiveMQ shutdown help
Date Wed, 24 Nov 2010 03:55:02 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message