diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachedSession.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachedSession.cs
index 32920d8b..f0912d67 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachedSession.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachedSession.cs
@@ -167,18 +167,6 @@ namespace Spring.Messaging.Nms.Connections
}
- ///
- /// Creates the producer given the destinaton and requst timeout, potentially returning a cached instance.
- ///
- /// The destination.
- /// The request timeout.
- /// The message producer
- public IMessageProducer CreateProducer(IDestination destination, TimeSpan requestTimeout)
- {
- LOG.Warn("RequestTimeout for Producers created from CachedSession not yet supported");
- return CreateProducer(destination, requestTimeout);
- }
-
///
/// If have not yet reached session cache size, cache the session, otherwise
/// dispose of all cached message producers and close the session.
@@ -280,18 +268,6 @@ namespace Spring.Messaging.Nms.Connections
}
- ///
- /// Creates the consumer for the given destinaton and request timeout, potentially returning a cached instance.
- ///
- /// The destination.
- /// The request timeout.
- /// A message consumer
- public IMessageConsumer CreateConsumer(IDestination destination, TimeSpan requestTimeout)
- {
- LOG.Warn("RequestTimeout not yet supported in CachedSesion.");
- return CreateConsumer(destination, null, false, null);
- }
-
///
/// Creates the consumer, potentially returning a cached instance.
///
@@ -303,19 +279,6 @@ namespace Spring.Messaging.Nms.Connections
return CreateConsumer(destination, selector, false, null);
}
- ///
- /// Creates the consumer, potentially returning a cached instance.
- ///
- /// The destination.
- /// The selector.
- /// The request timeout.
- /// A message consumer.
- public IMessageConsumer CreateConsumer(IDestination destination, string selector, TimeSpan requestTimeout)
- {
- LOG.Warn("RequestTimeout not yet supported in CachedSesion.");
- return CreateConsumer(destination, selector, false, null);
- }
-
///
/// Creates the consumer, potentially returning a cached instance.
///
@@ -328,22 +291,6 @@ namespace Spring.Messaging.Nms.Connections
return CreateConsumer(destination, selector, noLocal, null);
}
-
- ///
- /// Creates the consumer, potentially returning a cached instance.
- ///
- /// The destination.
- /// The selector.
- /// if set to true [no local].
- /// The request timeout.
- /// A message consumer
- public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal,
- TimeSpan requestTimeout)
- {
- LOG.Warn("RequestTimeout not yet supported in CachedSesion.");
- return CreateConsumer(destination, selector, noLocal, null);
- }
-
///
/// Creates the durable consumer, potentially returning a cached instance.
///
@@ -365,42 +312,19 @@ namespace Spring.Messaging.Nms.Connections
}
}
-
- ///
- /// Creates the durable consumer, potentially returning a cached instance.
- ///
- /// The destination.
- /// The name.
- /// The selector.
- /// if set to true [no local].
- /// The request timeout.
- /// A message consumer
- public IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal,
- TimeSpan requestTimeout)
- {
- LOG.Warn("RequestTimeout not yet supported in CachedSesion.");
- return CreateDurableConsumer(destination, name, selector, noLocal);
- }
-
-
///
/// Deletes the durable consumer.
///
- /// The name.
- public void DeleteDurableConsumer(string name)
+ /// The name of the durable subscription.
+ public void DeleteDurableConsumer(string durableSubscriptionName)
{
- throw new NotImplementedException();
+ if (shouldCacheConsumers)
+ {
+ throw new InvalidOperationException("Deleting of durable consumers is not supported when caching of consumers is enabled");
+ }
+ target.DeleteDurableConsumer(durableSubscriptionName);
}
- ///
- /// Deletes the durable consumer.
- ///
- /// The name.
- /// The request timeout.
- public void DeleteDurableConsumer(string name, TimeSpan requestTimeout)
- {
- throw new NotImplementedException();
- }
///
/// Creates the consumer.
@@ -408,14 +332,14 @@ namespace Spring.Messaging.Nms.Connections
/// The destination.
/// The selector.
/// if set to true [no local].
- /// The subscription.
+ /// The durable subscription name.
///
- protected IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal, string subscription)
+ protected IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal, string durableSubscriptionName)
{
this.transactionOpen = true;
if (shouldCacheConsumers)
{
- return GetCachedConsumer(destination, selector, noLocal, subscription);
+ return GetCachedConsumer(destination, selector, noLocal, durableSubscriptionName);
}
else
{
@@ -423,9 +347,9 @@ namespace Spring.Messaging.Nms.Connections
}
}
- private IMessageConsumer GetCachedConsumer(IDestination destination, string selector, bool noLocal, string subscription)
+ private IMessageConsumer GetCachedConsumer(IDestination destination, string selector, bool noLocal, string durableSubscriptionName)
{
- object cacheKey = new ConsumerCacheKey(destination, selector, noLocal, null);
+ object cacheKey = new ConsumerCacheKey(destination, selector, noLocal, durableSubscriptionName);
IMessageConsumer consumer = (IMessageConsumer)cachedConsumers[cacheKey];
if (consumer != null)
{
@@ -438,8 +362,8 @@ namespace Spring.Messaging.Nms.Connections
{
if (destination is ITopic)
{
- consumer = (subscription != null
- ? target.CreateDurableConsumer((ITopic)destination, subscription, selector, noLocal)
+ consumer = (durableSubscriptionName != null
+ ? target.CreateDurableConsumer((ITopic)destination, durableSubscriptionName, selector, noLocal)
: target.CreateConsumer(destination, selector, noLocal));
}
else
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs
index 457b8524..41ab6d37 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/CachingConnectionFactory.cs
@@ -252,24 +252,6 @@ namespace Spring.Messaging.Nms.Connections
return session;
}
- ///
- /// Template method for obtaining a (potentially cached) Session.
- ///
- /// The connection to operate on.
- /// The session ack mode.
- /// The request timeout.
- ///
- /// the Session to use, or null to indicate
- /// creation of a raw standard Session
- ///
- public override ISession GetSession(IConnection con, AcknowledgementMode mode, TimeSpan requestTimeout)
- {
- ISession session = GetSession(con, mode);
- LOG.Warn("RequestTimeout parameter not yet supported in CachingConnectionFactory");
- return session;
- }
-
-
///
/// Wraps the given Session so that it delegates every method call to the target session but
/// adapts close calls. This is useful for allowing application code to
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/SingleConnectionFactory.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/SingleConnectionFactory.cs
index 065a4dd5..69ee6caa 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/SingleConnectionFactory.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/SingleConnectionFactory.cs
@@ -325,21 +325,6 @@ namespace Spring.Messaging.Nms.Connections
return null;
}
- ///
- /// Template method for obtaining a (potentially cached) Session.
- ///
- /// The connection to operate on.
- /// The session ack mode.
- /// The request timeout.
- ///
- /// the Session to use, or null to indicate
- /// creation of a raw standard Session
- ///
- public virtual ISession GetSession(IConnection con, AcknowledgementMode mode, TimeSpan requestTimeout)
- {
- return null;
- }
-
///
/// reate a JMS Connection via this template's ConnectionFactory.
///