qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Howard <chris.how...@facilita.co.uk>
Subject Message not consumed by python messaging client
Date Mon, 13 Sep 2010 14:57:14 GMT
  Here is a simple python script that fetches a message from a queue:

import qpid.messaging

connection = qpid.messaging.Connection('amqp://localhost:5672')
connection.open()
session = connection.session()
receiver = session.receiver('myQueue; {create: receiver, delete: never, 
mode: consume}')
request = receiver.fetch(10)
print request.content
connection.close()


I have another python script that puts a message onto this queue:

import qpid.messaging

connection = qpid.messaging.Connection('amqp://localhost:5672')
connection.open()
session = connection.session()
sender = session.sender('myQueue')
request = qpid.messaging.Message(content = 'ping')
sender.send(request)
connection.close()


I start the first script, and then start the second script. As expected, 
the message is received and both scripts exit. However, if I then run 
the first script again, the same message is received again. This is 
probably just a misunderstanding on my part, but I would have expected 
the message to be consumed the first time the script was run. Please 
could someone explain why the message is not consumed and remains in the 
queue.

Regards,
Chris



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message