You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by user939393 <mi...@tideworks.com> on 2008/02/22 22:15:53 UTC

Connection Exception Listener

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: http://www.nabble.com/Connection-Exception-Listener-tp15641654s2354p15641654.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Connection Exception Listener

Posted by user939393 <mi...@tideworks.com>.
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?

Apache.NMS.ActiveMQ.Connection
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
	//SyncRequest(command);
	
	//Asynchronous call
	transport.Oneway(command);
}





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: http://www.nabble.com/Connection-Exception-Listener-tp15641654s2354p15814325.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.