commit | 2aae7603f2c573d2700a7ad243d279fe0df80253 | [log] [tgz] |
---|---|---|
author | Timothy A. Bish <tabish@apache.org> | Mon Aug 18 13:58:29 2014 +0000 |
committer | Timothy A. Bish <tabish@apache.org> | Mon Aug 18 13:58:29 2014 +0000 |
tree | 11defc5cfbc4b7231569a6fb8b15bf7ce2310b6a | |
parent | 9e963daf0f7b1fda64bbce59000b279f9619a4cc [diff] |
https://issues.apache.org/jira/browse/AMQNET-454 apply: https://issues.apache.org/jira/secure/attachment/12662486/Apache.NMS.AMQP-29-stop-sessions-before-connection.patch
diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs index 1d61690..2f55eda 100644 --- a/src/main/csharp/Connection.cs +++ b/src/main/csharp/Connection.cs
@@ -122,9 +122,6 @@ /// </summary> public void Stop() { - // Close qpidConnection - CheckDisconnected(); - // Administratively close NMS objects if (started.CompareAndSet(true, false)) { @@ -134,6 +131,9 @@ session.Stop(); } } + + // Close qpidConnection + CheckDisconnected(); } #endregion
diff --git a/src/main/csharp/MessageConsumer.cs b/src/main/csharp/MessageConsumer.cs index 691f187..e45ca3b 100644 --- a/src/main/csharp/MessageConsumer.cs +++ b/src/main/csharp/MessageConsumer.cs
@@ -116,13 +116,14 @@ { try { + Tracer.DebugFormat("Stop Consumer Id = " + ConsumerId); qpidReceiver.Close(); qpidReceiver.Dispose(); qpidReceiver = null; } catch (Org.Apache.Qpid.Messaging.QpidException e) { - throw new NMSException("Failed to close session with Id " + ConsumerId.ToString() + " : " + e.Message); + throw new NMSException("Failed to close consumer with Id " + ConsumerId.ToString() + " : " + e.Message); } } }
diff --git a/src/main/csharp/MessageProducer.cs b/src/main/csharp/MessageProducer.cs index af31358..7ac633a 100644 --- a/src/main/csharp/MessageProducer.cs +++ b/src/main/csharp/MessageProducer.cs
@@ -109,7 +109,7 @@ } catch (Org.Apache.Qpid.Messaging.QpidException e) { - throw new NMSException("Failed to close session with Id " + ProducerId.ToString() + " : " + e.Message); + throw new NMSException("Failed to close producer with Id " + ProducerId.ToString() + " : " + e.Message); } } }