You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by RobR <ro...@rad-con.com> on 2014/07/15 18:23:21 UTC

Looking for Python example of acknowledging messages

I am beginning to do my homework, and I think I have a basic idea of the
difference between a topic and a queue.  Since my current task is to send
messages to a queue (or a topic), I don't care how the message will be
received.  That's our client's responsibility.

But I remain curious.  I'd like to see the load-balancing feature of a queue
in action.  So, I'd like to write a consumer that reads a message, logs it,
and acknowledges it five seconds later.  Ten instances of this consumer
would be running.  A publisher would send a message every second.  I should
see the messages get distributed among all of the consumers (or at least
five of them).  

This would be easy, except that I can't find any examples of reading and
acknowledging messages in Python, and I've never written anything in Java. 
The only examples I have found illustrate writing to and reading from
topics.  Can someone point me to a Python example that would be a good
starting point?  Or at least tell me what package I need to use that would
allow me to create a Session object?  I've only got the stomppy package, and
that doesn't seem to have what I need.

Thanks very much!

RobR



--
View this message in context: http://activemq.2283324.n4.nabble.com/Looking-for-Python-example-of-acknowledging-messages-tp4683282.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Looking for Python example of acknowledging messages

Posted by artnaseef <ar...@artnaseef.com>.
Good questions.  For Perl and Python, I'm unsure; I know STOMP works with
them.  Of course, an openwire implementation will open up a lot of ActiveMQ
features, but I can't speak to the state of such solutions.

Maybe we'll get lucky and hear from someone with more experience in the area
;-).



--
View this message in context: http://activemq.2283324.n4.nabble.com/Looking-for-Python-example-of-acknowledging-messages-tp4683282p4683289.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Looking for Python example of acknowledging messages

Posted by RobR <ro...@rad-con.com>.
Thanks very much!  I'll check them out.

I'm not wedded to the STOMP protocol, but I haven't yet succeeded in
understanding what I've read about the different protocols available.  What
protocol should I use for a simple example like this, and what Python
package should I use that implements it?

Thanks again!

RobR



--
View this message in context: http://activemq.2283324.n4.nabble.com/Looking-for-Python-example-of-acknowledging-messages-tp4683282p4683286.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Looking for Python example of acknowledging messages

Posted by artnaseef <ar...@artnaseef.com>.
Have you seen this page?

http://stomp.github.io/implementations.html

It lists at least 2 Python solutions, one specific to ActiveMQ.  Note that
the the base STOMP protocol does not include acknowledgements; in perl,
that's the Net::Stomp module.  There is an enhancement that supports
acknowledgements, or "receipts" as Stomp calls them.  Here's an example perl
Net::Stomp::Receipt:

http://search.cpan.org/~huguei/Net-Stomp-Receipt-0.36/lib/Net/Stomp/Receipt.pm

If I find something for Python, I'll post it.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Looking-for-Python-example-of-acknowledging-messages-tp4683282p4683284.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.