diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-06-24 20:56:15 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-06-24 20:56:15 +0000 |
| commit | 0b3103151b3a27f7f9130eba77db79bf7d6fbcb5 (patch) | |
| tree | eaba121e587efcb83271448f349872dcba2d0f21 /qpid/java/client | |
| parent | 5e9e6b92900e40c0618535eb0a6df807fa873ed2 (diff) | |
| download | qpid-python-0b3103151b3a27f7f9130eba77db79bf7d6fbcb5.tar.gz | |
added system properties to control declaration of exchanges and queues
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@788179 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client')
| -rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java | 16 |
1 files changed, 14 insertions, 2 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 a40295a9b7..118be75705 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 @@ -205,6 +205,11 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic */ protected static final boolean DEFAULT_MANDATORY = Boolean.parseBoolean(System.getProperty("qpid.default_mandatory", "true")); + protected static final boolean DECLARE_QUEUES = + Boolean.parseBoolean(System.getProperty("qpid.declare_queues", "true")); + protected static final boolean DECLARE_EXCHANGES = + Boolean.parseBoolean(System.getProperty("qpid.declare_exchanges", "true")); + /** System property to enable strict AMQP compliance. */ public static final String STRICT_AMQP = "STRICT_AMQP"; @@ -2465,9 +2470,16 @@ public abstract class AMQSession<C extends BasicMessageConsumer, P extends Basic AMQProtocolHandler protocolHandler = getProtocolHandler(); - declareExchange(amqd, protocolHandler, nowait); + if (DECLARE_EXCHANGES) + { + declareExchange(amqd, protocolHandler, nowait); + } - AMQShortString queueName = declareQueue(amqd, protocolHandler, consumer.isNoLocal(), nowait); + if (DECLARE_QUEUES || amqd.isNameRequired()) + { + declareQueue(amqd, protocolHandler, consumer.isNoLocal(), nowait); + } + AMQShortString queueName = amqd.getAMQQueueName(); // store the consumer queue name consumer.setQueuename(queueName); |
