qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Sending a message to a custom QPID direct exchange from Python
Date Tue, 15 Feb 2011 11:32:39 GMT
On 02/14/2011 09:45 PM, Gregory Bayard wrote:
> Hi Gordon,
> I was originally working with 0.6 and the double-quoting was a quick
> attempt to find some problem with my exchange and queue specification.
>   When I updated my addressing string for Qpid 0.8, I still get the
> same result.  The message is picked up by topic listeners listening to
> the masterserver.summary.queue' topic on the 'masterserver.direct'
> exchange.  The string, as you specified, is now:
> "masterserver.direct/masterserver.summary.queue; {create: always,
> node: {type:topic, x-declare:{type:direct}}}"

To be clear, I don't think you need the "; {create: always, node: 
{type:topic, x-declare:{type:direct}}}" part, that was just as an 
example of the correct syntax.

> Keep in mind this queue will essentially always have been created by
> the C++ server which is essentially guaranteed to start before any
> Python clients.  I just can't figure out anyway to get Python to send
> messages to the 'masterserver.summary.queue' on the
> 'masterserver.direct' exchange.

Just to be clear, are you saying that creating a sender in python for 
the address "masterserver.direct/masterserver.summary.queue" and then 
sending a message with that, the messages do not get to the queue in 

That works fine for me, are you sure you don't have older python libs on 
your path?

> However, I have no problem sending
> messages to the 'amq.direct' direct exchange from Python.  This issue
> seems to be limited to custom direct exchanges.  Any suggestions on
> how I could get a message via the custom direct exchange created by
> the C++ from Python to the C++ server's queue would be greatly
> appreciated.

Are you getting errors or the messages just appear to be dropped? As I 
say it works fine for me with 0.8 packages. See attached client and 
server. The server is a modified version of the old example that I think 
matches what you describe, the client is a simple python program that 
sends to "masterserver.direct/masterserver.summary.queue". Start the 
server first, then run the client and that all works for me, does it 
work for you?

Btw, there is a messaging API in c++ as well that I think is a lot 
simpler than the old qpid/client API. It is conceptually similar to the 
python API you are using.

View raw message