Updated durable related error messages in TopicRegion to include both subscriptionName and clientId.

This resolves https://issues.apache.org/jira/browse/AMQ-5719
This commit is contained in:
Christopher L. Shannon (cshannon) 2015-04-13 20:17:01 +00:00
parent ec9a92f6fc
commit 72837960cf
1 changed files with 5 additions and 2 deletions

View File

@ -200,7 +200,8 @@ public class TopicRegion extends AbstractRegion {
SubscriptionKey key = new SubscriptionKey(info.getClientId(), info.getSubscriptionName()); SubscriptionKey key = new SubscriptionKey(info.getClientId(), info.getSubscriptionName());
DurableTopicSubscription sub = durableSubscriptions.get(key); DurableTopicSubscription sub = durableSubscriptions.get(key);
if (sub == null) { if (sub == null) {
throw new InvalidDestinationException("No durable subscription exists for: " + info.getSubscriptionName()); throw new InvalidDestinationException("No durable subscription exists for clientID: "
+ info.getClientId() + " and subscriptionName: " + info.getSubscriptionName());
} }
if (sub.isActive()) { if (sub.isActive()) {
throw new JMSException("Durable consumer is in use"); throw new JMSException("Durable consumer is in use");
@ -336,7 +337,9 @@ public class TopicRegion extends AbstractRegion {
} }
durableSubscriptions.put(key, sub); durableSubscriptions.put(key, sub);
} else { } else {
throw new JMSException("That durable subscription is already active."); throw new JMSException("Durable subscription is already active for clientID: "
+ context.getClientId() + " and subscriptionName: "
+ info.getSubscriptionName());
} }
return sub; return sub;
} }