[rabbitmq-discuss] Java API methods don't return nor throw exceptions

Holger Hoffstätte holger at wizards.de
Thu Dec 11 18:06:20 GMT 2008


Jonatan Kallus wrote:
> I am trying to write a java application that can handle the rabbitmq
> server going down and coming back up (or losing the connection to the
> server and getting it back).
[..]
> ConnectionFactory factory = new ConnectionFactory(params);
> connection = factory.newConnection(host, AMQP.PROTOCOL.PORT);
> channel = connection.createChannel();
> channel.accessRequest(this.realm);
> 
> Code above gets run through without any exceptions. But, when
> reconnecting, the execution stops at this line, the method seems to
> never return:
> 
> connection.addShutdownListener(shutdownListener);

Try to dump a stack trace so we can see who's calling what.
Easiest to do with jconsole or visualvm, or with the magic key combo that
I cannot remember right now..

> I have once seen addShutdownListener throw a
> ConcurrentModificationException, but the rabbitmq connection is not
> running in a multithreaded environment.

CME has nothing to do with threading and can also occur e.g. in recursive
code that improperly modifies the iterated collection.

-h




More information about the rabbitmq-discuss mailing list