Author: rhs Date: Wed Jun 24 20:56:15 2009 New Revision: 788179 URL: http://svn.apache.org/viewvc?rev=788179&view=rev Log: added system properties to control declaration of exchanges and queues
Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Modified: qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=788179&r1=788178&r2=788179&view=diff ============================================================================== --- qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original) +++ qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Wed Jun 24 20:56:15 2009 @@ -205,6 +205,11 @@ */ 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 @@ 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); --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org