Hi Gordon,
The message has an ReplyTo property, but it points to another
exchange, not to X. Also, the client sends the exchange query when
only reading the messages, not when replying to them. The client does
only this:
ConnectionFactory fact = (ConnectionFactory) ctx.lookup("connection");
Connection conn;
Session sess;
conn = fact.createConnection();
sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination requestDestination = (Destination)
ctx.lookup("requestAddress");
MessageConsumer requestConsumer;
requestConsumer = sess.createConsumer(requestDestination);
conn.start();
Message msg = requestConsumer.receive(100000);
where the destinations are following:
java.naming.factory.initial =
org.apache.qpid.jndi.PropertiesFileInitialContextFactory
# connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.connection =
amqp://amqpsrv:amqpsrv@/?brokerlist='tcp://cbgd01:20000'
# destination.[jndiname] = [address_string]
destination.requestAddress = Y; { node: { type: queue },
create: never, assert: never }
The producer of the received message is using following destinations:
destination.requestAddress = X; { node: { type: topic }, create: never }
destination.replyAddress = U/routing_key_1; { create: never,
node: { type: topic } }
When the queue is empty, and the receive() call time-outs, then it
doesn't send the exchange query. So it is clearly related to the
received message. I believe the message contains some property
describing the originating exchange. I assume the exchange query may
be sent when parsing this property, since that is the only one linking
to exchange X.
Thanks & Regards
Jakub
On Mon, Sep 5, 2011 at 09:50, Gordon Sim <[email protected]> wrote:
> On 09/04/2011 04:04 PM, Jakub Scholz wrote:
>>
>> Hi,
>>
>> I'm using a Java program in following scenario:
>> 1) I have an topic exchange named X
>> 2) I have queue named Y
>> 3) I have a binding routing the messages from exchange X to queue Y
>> 4) All objects - exchange, queue and binding - are predefined. They
>> already exists when a Java client connects to the queue Y and tries to
>> read a message from the queue. In general it works fine.
>>
>> But the other day I noticed, that the Java client, after picking up
>> the message from the queue Y, sends and ExchangeQuery command for the
>> exchange X to the AMQP broker. That seems strange to me, because I
>> don't see any reason to do so ...
>
> Are you setting a reply-to address on the message being sent? If not, what
> addresses are you using (just the name of the exchange for producer and name
> of queue for consumer?)
>
>> It is of course not a big issue, but:
>> 1) It seems to be one unnecessary command for every received message
>> (so it may have some performance impact)
>> 2) The Java client needs to be allowed to query an exchange (in case
>> strict ACL rules are used)
>>
>> Why does the Java client (Qpid 0.10) send this request? Is it an error
>> or is it ok? Can it be swicthed off using some option?
>>
>> Thanks& Regards
>> Jakub
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project: http://qpid.apache.org
>> Use/Interact: mailto:[email protected]
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:[email protected]
>
>
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]