You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by François Thillen <fr...@gmx.net> on 2013/02/06 17:56:46 UTC

Closing connection

Dear Apache team,

 

I have a problem with closing a connection in my c# project.

 

Always when I open the connection, i am closing it as well. However, when I
close the complete application, ActiveMQ is blocking and so it is not
possible to close the my application. Here is my connection code:

 

        protected void Configure()

        {

            try

            {

                Destination dest = new Destination(string_destination);

                Uri connectionUri = new Uri(dest.Host);

                factory = new
Apache.NMS.ActiveMQ.ConnectionFactory(connectionUri);

                connection = factory.CreateConnection();

                session = connection.CreateSession();

                connection.Start();

                this.destination = session.GetDestination(dest.Queue);

            }

            catch (Exception ex)

            {

               handling.HandleException(ex);

            }

        }

    

        protected void Close()

        {

            session.Close();

            session.Dispose();

     //connection.Stop();

            connection.Close();

            connection.Dispose();

            connection = null;

            close = true;

        }

 

I figured out that ActiveMQ blockes in the Class ThreadPoolExecutor.cs at
the line 122 (this.executionComplete.WaitOne();)

 

Did I missed closing something?

 

Thank you very much

 

Best regards

François