#165 MessageConsumer.receive() get stuck in a server shutdown

v0.7.7-beta-1
open
client (26)
7
2008-03-11
2008-02-12
arielUBA
No

If you are receiving messages synchronously (using a consumer) and the server is shutdown, the client still waiting for a message and does not throw any exception (neither returns null)

MessageConsumer receiver = session.createConsumer(destination);
connection.start();
TextMessage message = (TextMessage) receiver.receive();

If you register an ExceptionListener you realize that an exception is thrown from org.exolab.jms.client.net.JmsServerStubImpl.disconnected(Caller) but it does not have any error code. So, the JmsConnection won't be closed (because it expects JmsErrorCodes.CONNECTION_TO_SERVER_DROPPED as error code).

IMHO, JmsServerStubImpl.disconnected(Caller) should be:

public void disconnected(Caller caller) {
if (_listener != null) {
_listener.onException(new JMSException("Lost connection", JmsErrorCodes.CONNECTION_TO_SERVER_DROPPED));
}
}

Discussion

  • arielUBA

    arielUBA - 2008-02-12

    thread dump

     
    Attachments
  • arielUBA

    arielUBA - 2008-03-11
    • priority: 5 --> 7
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks