qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger <roger.lefeb...@pason.com>
Subject Hard-coded destination parameters prevent creation of Producer and Consumer
Date Tue, 21 Aug 2012 15:51:51 GMT
Trying to connect to pre-existing durable destinations on RabbitMQ. Using
qpid 0.16.
When trying to create a producer of consumer extending the Hello.java
example, the server logs the following:

{amqp_error,precondition_failed,
            "cannot redeclare exchange 'myExchange' in vhost '/' with
different type, durable, internal or autodelete value",
            'exchange.declare'}

The key entries in my property file are as follows:

connectionfactory.qpidConnectionfactory =
amqp://guest:guest@localhost/?brokerlist='tcp://localhost:5672'
destination.queue =
BURL:direct://myExchange//myQueue?autodelete='false'&durable='true'&internal='false'&routingkey='testRoute'

I downloaded the source and found that
BasicMessageProducer.declareDestination method makes a
createExchangeDeclareBody call with hard-coded boolean values for the
durability, autodelete, internal and nowait parameters. A similar approach
exists in AMQSession_0_8.sendExchnageDeclare which is called when setting up
a consumer.

Why are these hard-coded when the destination contains some (durable,
autodelete) of the required values?
There is a comment following the code which states:

// Note that the durable and internal arguments are ignored since passive is
set to false

This is inaccurate as passive is set to:

destination.getExchangeName().toString().startsWith("amq.")

When I changed the code to use the destination values, it successfully
created  the producer. I can now send messages.
With respect to the consumer, the ExchangeDeclareBody was successfully
created, but the system hangs on protocolHandler.syncWrite. Digging into
that now.

With respect to other hard coded booleans, I'm not familiar with the purpose
of the nowait parameter yet, or its possible source, so I left it unchanged
in my implementation. The internal boolean, seems to be associated with the
exchanged name. Will familiarize myself and possibly update in future reply.
It too was left as is.

Any advice or insight on the issues I've resolved or am currently
encountering would be appreciated.

Thx,
Roger



--
View this message in context: http://qpid.2158936.n2.nabble.com/Hard-coded-destination-parameters-prevent-creation-of-Producer-and-Consumer-tp7581160.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message