diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2011-03-14 16:44:15 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2011-03-14 16:44:15 +0000 |
commit | 9bc85beb39fc11371a7c62c7405740181833cab3 (patch) | |
tree | 12ee763c1e793b2662286625c45ac6c8a84f7eb5 /java | |
parent | 0eb58a5ff1f5dbdd4f9b85e083207bdef041e9bf (diff) | |
download | qpid-python-9bc85beb39fc11371a7c62c7405740181833cab3.tar.gz |
QPID-3143
Removed the line which sets the create option to 'always'. Please note that the default create option is set to 'never'.
Therefore if just a queue name is specified the client will throw an exception if that queue is not present in the broker.
However this check will only be performed when a producer or consumer is created using that destination.
Also modified the existing test case to verify the default and the explicit create case.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1081460 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/AMQSession.java | 1 | ||||
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java | 15 |
2 files changed, 15 insertions, 1 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 5c2949960c..5fc8d43e94 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 @@ -1225,7 +1225,6 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic else { AMQQueue queue = new AMQQueue(queueName); - queue.setCreate(AddressOption.ALWAYS); return queue; } diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java index 0480ea4cab..837f3b0405 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java @@ -527,7 +527,22 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase cons.close(); // Using the ADDR method + // default case queue = ssn.createQueue("ADDR:my-queue2"); + try + { + prod = ssn.createProducer(queue); + fail("The client should throw an exception, since there is no queue present in the broker"); + } + catch(Exception e) + { + String s = "The name 'my-queue2' supplied in the address " + + "doesn't resolve to an exchange or a queue"; + assertEquals(s,e.getCause().getCause().getMessage()); + } + + // explicit create case + queue = ssn.createQueue("ADDR:my-queue2; {create: sender}"); prod = ssn.createProducer(queue); cons = ssn.createConsumer(queue); assertTrue("my-queue2 was not created as expected",( |