SPRNET-1222 MessageQueueFactoryObject.GetObject() sets global MessageQueue.EnableConnectionCache property

This commit is contained in:
markpollack
2009-07-28 19:58:14 +00:00
parent b60f2f53bb
commit ca819eed8a
2 changed files with 2 additions and 8 deletions

View File

@@ -228,17 +228,13 @@ namespace Spring.Messaging.Listener
/// <summary>
/// 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.
/// </summary>
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();
}

View File

@@ -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)
{