Something like this.. 44 msg = Message() 45 while True: 46 mng.recv() 47 while mng.incoming: 48 try: 49 mng.get(msg) 50 mng.accept() 51 except Exception, e: 52 print e 53 else: 54 print msg.address, msg.subject or "(no subject)", msg.properties, msg.body
On Thu, Dec 12, 2013 at 5:58 AM, Christian Posta <christian.po...@gmail.com> wrote: > That's right. You have to ack the message. Maybe you can post your consumer > python script? > > > On Thursday, December 12, 2013, xbhanu wrote: >> >> Hi, >> >> I am using AMQP Messenger API in Python and I am getting duplicate >> messages >> while using queues. Even though my consumer receives the message, ActiveMQ >> does not increment the dequeue count (seen through Jconsole). As a result, >> whenever I connect back the consumer I end up getting the same messages >> again and again. So a message once enqueued is received every time again. >> The other interesting thing here is I am printing the body of the message >> (a >> simple string), the body gets printed only the first time. >> >> Anybody, any idea on how to tell ActiveMQ that I have received the message >> !! Some sort of acknowledgement ?? I do not see any way of acking in the >> messenger API !! >> >> Thanks, >> Bhanu >> >> >> >> -- >> View this message in context: >> http://activemq.2283324.n4.nabble.com/Problems-with-the-AMQP-python-messenger-API-tp4675451.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > > > -- > Christian Posta > http://www.christianposta.com/blog > twitter: @christianposta > -- Christian Posta http://www.christianposta.com/blog twitter: @christianposta