activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From user939393 <>
Subject Re: Connection Exception Listener
Date Mon, 03 Mar 2008 21:24:51 GMT

After stepping through the debugger, I discovered that
Connection.DisposeOf(DataStructure objectId) sends a synchronous call to the
server. This then waits forever since the server has gone down.

Changing it to asynchronous, fixes the problem.

Despite the original comment regarding race conditions below, it seems
reasonable to me that this should be an asynchronous call and then let the
client be responsible for the timing of disposing/recreating of the same
object in the broker.

Any thoughts or comments?

public void DisposeOf(DataStructure objectId)
	RemoveInfo command = new RemoveInfo();
	command.ObjectId = objectId;
	// Ensure that the object is disposed to avoid potential race-conditions
	// of trying to re-create the same object in the broker faster than
	// the broker can dispose of the object.
	//Synchronous call
	//Asynchronous call

user939393 wrote:
> I'm having some problems on the client with IConnection.ExceptionListener.
> When the ActiveMQ server is shutdown, this Listener is fired in my client
> app as expected. However, when I then go and close/dispose of the client
> connection, subscription, and messageconsumer during this event the
> debugger shows that the client thinks the connection, etc are still alive
> and when the client app goes into these lines, the close/dispose never
> return and the app stops at these lines.
> Does anyone know of a work around. I don't want to leave these resources
> open and would like a way to close them.
> NMS Client 5.1
> ActiveMQ 5.0
> Thanks. 

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message