diff --git a/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs b/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs index e6774f29..2e4127ab 100644 --- a/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs +++ b/src/Spring/Spring.Messaging/Messaging/Listener/AbstractMessageListenerContainer.cs @@ -228,17 +228,13 @@ namespace Spring.Messaging.Listener /// /// Closes the queue handle. Cancel pending receive operation by closing the queue handle - /// To dispose of the queue handle, set EnableConnectionCache=false and call Close/Dispose. + /// To properly dispose of the queue handle, ensure that EnableConnectionCache=false on the + /// MessageQueue that this listener is configured to use. /// protected void CloseQueueHandle(MessageQueue mq) { lock (messageQueueMonitor) { - if (MessageQueue.EnableConnectionCache == true) - { - LOG.Info("Setting global property MessageQueue.EnableConnectionCache from true to value in order to dispose property of the queue handle"); - } - MessageQueue.EnableConnectionCache = false; mq.Close(); mq.Dispose(); } diff --git a/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs b/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs index c8c45c59..8a8a2374 100644 --- a/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs +++ b/src/Spring/Spring.Messaging/Messaging/Support/MessageQueueFactoryObject.cs @@ -202,8 +202,6 @@ namespace Spring.Messaging.Support } else { - // TODO (EE): is it really a good idea to set a global property from within an instance? - MessageQueue.EnableConnectionCache = enableConnectionCache; MessageQueue mq = new MessageQueue(Path, DenySharedReceive, EnableCache, AccessMode); if (messageReadPropertyFilterSetDefaults) {