[rabbitmq-discuss] RabbitMQ, Gretty, and Channel question
Burt Prior
burtprior at comcast.net
Wed Sep 28 18:21:23 BST 2011
Hi Peter! Thanks for following up on this. I appreciate it.
> Are you looking on the queue directly through the RabbitMQ management
> interface or the rabbit command line tools?
I installed the RabbitMQ management web interface, and this is where I
see '10003' instead of '10000'.
After stopping my consumer, I run 'ab' a number of times against the
Gretty code, and for lower numbers like 100 or 1000 it seems to work
perfectly. (i.e. i see 100 or 1000 in the web interface queues).
When I run 'ab' using 10000 or 100000 is where i start seeing the
duplicates. I've been pounding the equivalent Grails app I built with
'ab' and I NEVER see duplicates on the queue.
This issue is actually easily reproducible with the included Gretty
code and setting up a 'direct' queue as in the first RabbitMQ
tutorial, and viewing the results in the web interface (don't consume
yet) and with 'ab -n 10000 -c 100 http://localhost:8080/gretty/whatever'
> Also, are you able to check how many times basicPublish() is called? Perhaps it's called 1003 times for some reason.
Well, i'm not sure how to do that in Gretty. Would I just set up a
counter in that handler? Not sure how that works with an event-driven
async framework.
I'm also wondering how 'ab' would ever send more than 10 or 100 or
10000? (more than you specified)
> Finally, are you checking the number of messages on the queue before running ab?
Yes, there are no messages on the queue at all, so it's easy to see,
since I stopped my consumer.
Thanks again for your great reply. I was quite surprised when I saw
this, and I realized I needed to reach out and understand what is
happening before I propose Gretty + RabbitMQ for production use.
Burt Prior
On Sep 28, 6:57 am, Peter Ledbrook <pe... at cacoethes.co.uk> wrote:
> > Testing the above web service with: 'ab -n 10000 -c 100
> >http://localhost:8080/web-service/activity
> > This works great. this puts 10,000 messages on the queue perfectly (a
> > bit slowly) every time.
> > I think works perfectly because a new thread is created by tomcat for
> > every request.
> > That's why I don't have to worry about channel thread safety.
>
> > This is NOT the case with Gretty, for reasons I don't understand.
>
> Apparently the channel is not thread-safe, but that is very unlikely
> to result in extra messages.
>
> Are you looking on the queue directly through the RabbitMQ management
> interface or the rabbit command line tools? Or are you consuming?
> Also, are you able to check how many times basicPublish() is called?
> Perhaps it's called 1003 times for some reason. Finally, are you
> checking the number of messages on the queue before running ab? I
> assume you are, but I have to ask :)
>
> Cheers,
>
> Peter
>
> --
> Peter Ledbrook
> Grails Advocate
> SpringSource - A Division of VMware
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list