[rabbitmq-discuss] Python / QPID to RabbitMQ....the plot thickens.....

Lynton Grice lynton.grice at netweaverguru.com
Mon Oct 1 17:17:02 BST 2007


Hi there,

I am using Python 2.4 from python.org and have installed
python-qpid-0.2.tar.gz on my Windows Box.....I also have RabbitMQ version
1.2....

mmmmmm......the plot thinkens.....I use WingIDE for all my Python
development, and I can see that the code does indeed run successfully in the
Python SHELL but the moment you try run it in the IDE it complains about the
"__eq__" stuff.

See attached screenshots of it working well in the Wing Python Shell.....and
then the moment you try run the SAME script in the IDE it
dies.....mmmmm......and the IDE uses Python 2.4 as well......and the shell
in the screenshot is run from Wing IDE.......so it should be EXACTLY the
same......let me dig into it more.......

Thanks for all your help.....must be some bug in WingIDE.....not sure yet, I
will let you guys know once I find out.....

Chat soon

Lynton

-----Original Message-----
From: Dmitriy Samovskiy [mailto:dmitriy.samovskiy at cohesiveft.com] 
Sent: 01 October 2007 05:01 PM
To: Lynton Grice
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Python / QPID to RabbitMQ....no MLLIB??

Hi Lynton,

Lynton Grice wrote:
> 
> I get EXACTLY the same error when I try to run the "disttailf.py -c" after
> running disttailf.py d:\tmp\rabbit\rabbit.py.
> 
> The error seems to only be when I try to GET messages from
> RabbitMQ....putting them on is fine.....
> 
> Here is the error again:
> 
> AttributeError: __eq__
> 
> Traceback (innermost last):
> 
> File "d:\Documents and Settings\Lynton\Desktop\disttailf.py", line 1, in ?
> File "d:\Documents and Settings\Lynton\Desktop\disttailf.py", line 118, in
?
>   consumer(client, ch)
> File "d:\Documents and Settings\Lynton\Desktop\disttailf.py", line 38, in
> consumer
>   msg = python_queue.get(timeout=1)
> File "D:\Python24\Lib\site-packages\qpid\queue.py", line 46, in get
>   if result == Queue.END:
> File "D:\Python24\Lib\site-packages\qpid\message.py", line 61, in
> __getattr__
>   raise AttributeError(attr)
> 


The good news is that I was able to run your code and successfully 
sent/received a message. The bad news is that I still can't tell you 
what's wrong with your setup. But I am almost positive it's not related 
to rabbitmq or qpid python libraries.

To make a long story short, my interpreter also raises AttributeError on 
'__eq__' (which appears to be correct behavior). My interpreter however 
catches and processes this exception internally, vs. your interpreter 
doesn't.

What kind of python are you using? Original from python.org or something 
like ActivePython or maybe yet another flavor? I use original from 
python.org. Or maybe this is platform related (I use Debian Linux). 
Also, is it possible that you have more than one interpreter on your 
system and the one which you actually call is not the one from 
d:\python24\bin? Maybe try "d:\python24\bin\python.exe 
d:\tmp\rabbit\rabbit.py" ? These are just guesses however.

Here is my output from your code, with certain debug print outs from 
qpid.message.__getattr__():

inside __getattr__ Method(name=start, id=10) (8, 0, {'platform': 
'Erlang/OTP', 'product': 'RabbitMQ', 'version': '1.2.0', 'copyright': 
'Copyright (C) 2007 LShift Ltd., Cohesive Financial Technologies LLC., 
and Rabbit Technologies Ltd.', 'information': 'Licensed under the MPL. 
See http://www.rabbitmq.com/'}, 'PLAIN AMQPLAIN', 'en_US') content = 
None start_ok
res 2
result is <function respond at 0xa7954c34>

inside __getattr__ Method(name=tune, id=30) (0, 131072L, 0) content = 
None tune_ok
result is <function respond at 0xa7954c34>

Sending message "ping"...   done
Receiving message
inside __getattr__ Method(name=consume_ok, id=21) 
('amq.ctag13_rabbit at dsy025_20071001141609_',) content = None consumer_tag
result is amq.ctag13_rabbit at dsy025_20071001141609_

inside __getattr__ Method(name=deliver, id=60) 
('amq.ctag13_rabbit at dsy025_20071001141609_', 10000L, False, 
'amq.direct', 'test') content = {} ping consumer_tag
result is amq.ctag13_rabbit at dsy025_20071001141609_

inside __getattr__ Method(name=deliver, id=60) 
('amq.ctag13_rabbit at dsy025_20071001141609_', 10000L, False, 
'amq.direct', 'test') content = {} ping __eq__
raising AttributeError __eq__
inside __getattr__ Method(name=deliver, id=60) 
('amq.ctag13_rabbit at dsy025_20071001141609_', 10000L, False, 
'amq.direct', 'test') content = {} ping __coerce__
raising AttributeError __coerce__
inside __getattr__ Method(name=deliver, id=60) 
('amq.ctag13_rabbit at dsy025_20071001141609_', 10000L, False, 
'amq.direct', 'test') content = {} ping __cmp__
raising AttributeError __cmp__
Got message: ping




- Dmitriy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wing.jpg
Type: image/jpeg
Size: 81808 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20071001/7ead2877/attachment.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shell.jpg
Type: image/jpeg
Size: 29201 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20071001/7ead2877/attachment-0001.jpg 


More information about the rabbitmq-discuss mailing list