diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-05-11 21:43:58 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-05-11 21:43:58 +0000 |
commit | ff450f2947eaa1482afa482b3289893a17f89edf (patch) | |
tree | ea834430040c2948460d7463dea8de09636e7005 | |
parent | f59425c33e4902bdac5c095e21511093466663e2 (diff) | |
download | qpid-python-ff450f2947eaa1482afa482b3289893a17f89edf.tar.gz |
QPID-3254
Added a check to ensure that durable subscriptions are only created for Topics.
Added code to mark a destination durable. If the addressing string explicitly specified durable==false, it will be overriden.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1102102 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index f85b1e655d..25562cfff7 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -1058,6 +1058,11 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic try { handleAddressBasedDestination(dest,false,true); + if (dest.getAddressType() != AMQDestination.TOPIC_TYPE) + { + throw new JMSException("Durable subscribers can only be created for Topics"); + } + dest.getSourceNode().setDurable(true); } catch(AMQException e) { |