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 | ecd4edb43908da524b50dc08744886e4f9df2f2b (patch) | |
| tree | c630cef17d9a8b5a3622e250a7616d3b35895ba5 | |
| parent | 705bb55c6f4f21d9165e4297973d0b51603ffde9 (diff) | |
| download | qpid-python-ecd4edb43908da524b50dc08744886e4f9df2f2b.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@1081460 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java | 1 | ||||
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java | 15 |
2 files changed, 15 insertions, 1 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 5c2949960c..5fc8d43e94 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 @@ -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/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java index 0480ea4cab..837f3b0405 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java +++ b/qpid/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",( |
