summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2011-05-11 21:43:58 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2011-05-11 21:43:58 +0000
commitff450f2947eaa1482afa482b3289893a17f89edf (patch)
treeea834430040c2948460d7463dea8de09636e7005
parentf59425c33e4902bdac5c095e21511093466663e2 (diff)
downloadqpid-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.java5
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)
{