qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajith Attapattu <rajit...@gmail.com>
Subject Re: svn commit: r788179 - /qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
Date Wed, 24 Jun 2009 23:01:10 GMT
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, <rhs@apache.org> 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:commits-subscribe@qpid.apache.org
>
>



-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message