[rabbitmq-discuss] txAMQP and RPC

Brennan Sellner bsellner at seegrid.com
Wed Oct 27 04:19:10 BST 2010


<facepalm>  That would be it.  No idea why I was convinced that it was
part of publish.  Thanks!

For anyone else who might be curious, just set the "reply to" key of the
Content object before publishing it, thusly:

from txamqp.content import Content

def send ( msg, exchangeName, replyTo, routingKey ):
   txMsg = Content ( msg.SerializeToString() )
   txMsg["reply to"] = replyTo
   d = self.chan.basic_publish ( exchange = exchangeName,
                                 content = txMsg,
                                 routing_key = routingKey )

Thanks for the rapid response!

-Brennan

On Wed, 2010-10-27 at 10:17 +0800, Alvaro Videla wrote: 
> Hi,
> 
> First I don't know much about txAMQP, so I don't know where you will have to check, but reply_to is a property of the message, is not part of the basic_publish method.
> 
> Regards,
> 
> Alvaro
> 
> On Oct 27, 2010, at 10:11 AM, Brennan Sellner wrote:
> 
> > Hi folks,
> > 
> > Does anyone have example code floating around for implementing RPC using
> > txAMQP and Rabbit?  I'm familiar with the concepts, and am able to
> > declare, bind, and consume the private queue.  However, I've been
> > unsuccessful in my attempts to set the reply-to field when publishing:
> > basic_publish complains about an unexpected keyword argument when
> > provided with 'replyTo', 'reply to', 'reply-to', or 'reply_to' keywords
> > (with a value of a simple string).
> > 
> > We're using Rabbit 1.8.1, txAMQP 0.3.1, and the
> > amqp0-8.stripped.rabbitmq.xml spec file that comes with txAMQP.  I'm
> > guessing the issue is that the 'publish' method of the 'basic' class in
> > the spec doesn't have a reply-to field declared (although neither the
> > 0.9 nor the 0.9.1 specs have such a field).  I tried adding one for
> > kicks, but then Rabbit complains that it can't decode basic.publish and
> > nukes the client connection.  I see Java implementations of RPC that
> > allude to a reply-to field, so I'm betting the issue isn't a lack of
> > support on Rabbit's end.
> > 
> > While we could add a reply-to field to all of our messages, that's
> > rather inelegant.  I'm pretty sure I'm missing something here: anyone
> > know what? :-)
> > 
> > Thanks,
> > 
> > -Brennan
> > 
> > 
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 




More information about the rabbitmq-discuss mailing list