[Twisted-Python] AMQP Twisted Application and authentication

Jonathan Stoppani jonathan at garetjax.info
Tue Aug 18 05:41:36 EDT 2009


Hi All,
I'm new to twisted but already fall in love with it... ;-)

I'm using the txAMQP library to connect and consume messages from an
AMQP server.

The examples of the txamqp library shown how to connect to the message
broker using the ClientCreator class.
What I'm trying to do is to use the twisted application framework.
Until now I succeeded to connect by creating a factory to use with
twisted.application.internet.TCPClient.

My two questions are:
1) Is this the right way to do this? Is it not possible to use the
ClientCreator class directly?
and
2) If this is the right way, when and where should I handle the AMQP
authentication?
   To authenticate to the message broker, the "authenticate" method of
the AMQClient instance must be called. This class is instantiated in
the buildProtocol method of the client factory. Is this the right
place to call this method too? Or is it better if I create a wrapper
class around the AMQPClient which then authenticates when the
connectionMade callback is called?

Thanks for the help

~jonathan

-- 
Best Regards,
Jonathan Stoppani



More information about the Twisted-Python mailing list