jandelgado/rabtap

Feature Request: Limit number of messages consumed

hrobertson opened this issue · 5 comments

Thanks for this really useful tool!
I'd like to be able to consume n messages per invocation.
Additionally I'd like to be able to use the --delay option when consuming to limit the rate at which messages are consumed.

eg rabtap sub somequeue --limit 10 --delay 30s would consume 1 message every 30s until 10 messages had been consumed.

Is this something you might consider implementing?
Thanks!

That just reminded me that already started building this feature in March, but somehow I had to change priorities and work stalled :-(

Thanks for the reminder. I just opened a PR for this (#54)

I'll check if the --delay option can be easily added too.

Also need exact this feature!

@Antiarchitect, @hrobertson: I've added a --limit=NUM option in #54 and the ability to optionally reject/requeue messages. You can build a version to test with go get github.com/jandelgado/rabtap/cmd/rabtap@3b4c6eb823e89edc620efe10ed1ad0450fb3d997. Please tell me if this works for you

@jandelgado Worked like a charm for me! Thank you once again! Now waiting for the official release :)

Thanks @jandelgado This looks good.
I'm not working with Rabbit these days but I'm sure I'll make use of this feature in the future.

Thanks!