qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Conway <acon...@redhat.com>
Subject Re: Complete Example of Python QPid Usage??
Date Thu, 31 Jan 2008 14:08:59 GMT
jazzcat2 wrote:
> Howdy Folks,
> 
> I'm looking for a complete simple example of how to, using Python-QPid:
> 
> 1. Open connection to queue manager,
> 2. establish a send and recv queues,
> 3. Wait for msgs to appear on recv queue,
> 4. process answer,
> 5. Deposit msg on send queue.
> 
> I have hacked something together, and it is attached.  However, it doesn't
> work.  When it gets to the client.start line on line 22, something in the
> client.py code - specifically, when client.py tries to do a connection_open,
> it raises a Closed exception.
> 
> Traceback (most recent call last):
>   File
> "/home/josh_dev/ide/eclipse/plugins/org.python.pydev.debug_1.3.11/pysrc/pydevd.py",
> line 803, in ?
>     debugger.run(setup['file'], None, None)
>   File
> "/home/josh_dev/ide/eclipse/plugins/org.python.pydev.debug_1.3.11/pysrc/pydevd.py",
> line 655, in run
>     execfile(file, globals, locals) #execute the script
>   File "/home/josh_dev/Projects/app/src/app.py", line 83, in ?
>     mqChannel = GetMQConnection()
>   File "/home/josh_dev/Projects/app/src/app.py", line 44, in GetMQConnection
>     mq_client.start('\0' + mqServerUser + '\0' + mqServerPass)
>   File "/usr/lib/python2.4/site-packages/qpid/client.py", line 83, in start
>     self.channel(0).connection_open(self.vhost)
>   File "<string>", line 3, in connection_open
>   File "/usr/lib/python2.4/site-packages/qpid/peer.py", line 182, in invoke
>     raise Closed(self.reason)
> qpid.peer.Closed
> 

There are a ton of examples in the python/tests* directories most pretty 
simple. Check the one thats appropriate to the amqp version of the 
broker you're using.



Mime
View raw message