activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dris <>
Subject Re: Orphan connections from .NET clients
Date Tue, 26 Jun 2007 15:19:04 GMT

OK, I compiled the following against a recent-ish version of NMS. I haven't
done a more recent compile because as I pointed out in the NMS issue tracker
there was a bug in the use of selectors which I had fixed in my source but
which hadn't been fixed in the SVN Repo (though it might have been very
recently). This is just your original post with your disconnect logic shoved
in the finally block. When I monitor this in JConsole the connection gets
cleaned up fine and there is no Connection folder under localhost in the
MBeans treeview. Hope this helps (though obviously it doesn't I guess!).
Happy to mail you my NMS.dll and ActiveMQ.dll compiles for you to try.


using System;
using System.Threading;
using NMS;

namespace ActiveMQ
	class TestMain
		static void Main(string[] args)
			Uri uri = new Uri("tcp://bhw152:61616");
			ConnectionFactory factory = new ConnectionFactory(uri);
			IConnection connection = null;
			ISession session = null;
				connection = factory.CreateConnection();
				Console.WriteLine("Connection Created");
				connection.ClientId = "[test1] " + connection.ClientId;
				session = connection.CreateSession();
				Console.WriteLine("Session Created");
					if (session != null)
					if (connection != null)
				catch (Exception ex)
					Console.WriteLine("ERROR DISCONNECTING: " + ex.StackTrace);
				Console.WriteLine("Connection Closed");
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message