Rafi, As I see a very minor issue with this commit is that it also prevents a queue declare when a queue created using the session.createQueue(<queue-name>); method is used in creating a message consumer. IMO when this method is called the user expects a queue to be created dynamically (even if -Dqpid.declare_queues=false ). IMO I think the "qpid.declare_queues" switch should be for destinations that we look up via JNDI.
Regards, Rajith On Wed, Jun 24, 2009 at 4:56 PM, <[email protected]> wrote: > 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:[email protected] > > -- Regards, Rajith Attapattu Red Hat http://rajith.2rlabs.com/ --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
