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
commitedc65efef91c7073b3caa8190184b6e3a6f756a4 (patch)
tree07b77bd0cb5a1a65fdae3e78426384e138681c5c
parent033eb9e75a08ce2d68485e826d303e48cf7bb157 (diff)
downloadqpid-python-edc65efef91c7073b3caa8190184b6e3a6f756a4.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/qpid@1102102 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSession.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
index f85b1e655d..25562cfff7 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/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)
{