On Fri, 2007-06-08 at 11:27 -0400, Jonathan Robie wrote:
> Robert Godfrey wrote:
> > The arrival of messages from a consumer are essentially events...
> > which presumably should be handled by some sort of listener... that
> > concept doesn't occur in the API... how does the python client handle
> > it?
> 
> Python didn't used to have a listener, but it does now.
> 
> I'm attaching a working Python consumer app that shows how to use a 
> listener.
> 
> Jonathan

The python client handled consume originally by having a map of queues
named after consumers. Message for consumer "foo" goes in queue["foo"]

Adding a listener object is a recent addition and a perfect example of
how to build an AMQP API. Start with a straight mapping of AMQP
classes/methods. Add the hidden machinery to make it work, then sprinkle
on some convenience classes/functions to tie it all together. There's no
need to design a complicated "AMQP API", AMQP already does (almost)
define an API.

The main issue here is that the API changes as AMQP changes but I
wouldn't over-estimate it. The C++ API is a sort of "AMQP-ish" API that
survived the 0-9 to 0-10 shift. However if we had-had a pure AMQP API we
could equally have survived the shift by re-implementing the 0-8 classes
in terms of 0-9 operations. With the exception of the Basic Message it
would have been trivial. 

I'm going to create a JIRA for this in C++. The C++ API has bothered me
for a while. It's non-standard, AMQP-ish but not quite but provides very
little value over a straight AMQP API.

Cheers,
Alan.

Reply via email to