[rabbitmq-discuss] RabbitMQ, Gretty, and Channel question
Burt Prior
burtprior at comcast.net
Fri Sep 23 20:02:39 BST 2011
Hi Peter!
Thanks for your reply. I'm extremely excited about the possibilities
of RabbitMQ and Gretty for the architecture (EDA) and app i'm
building.
Here's what I did last night: I created a bare-bones Grails app
(1.3.7/tomcat), installed the rabbit plugin, and coded simple a web
service interface in UrlMappings and a (rest) controller that sends a
text message every time the web service is invoked. (later I'll pass
JSON as the message transport)
class ActivityRestController {
def sendMessage = {
rabbitSend 'hello', 'someMessage'
}
}
GET /web-service-app/activity
As i mentioned, I want a simple web service endpoint that put (JSON)
messages on the queue.
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.
Could I get your thoughts on this?
Thanks very much,
Burt Prior
On Sep 22, 1:34 am, Peter Ledbrook <pe... at cacoethes.co.uk> wrote:
> > I've included the (working, no error) Gretty code below. Could I ask for
> > your insight as to why there are more messages in the queue than the
> > producer (ab) sent?
>
> Have you tried counting the number of requests that Gretty is
> handling? Assuming that there are zero messages on the queue
> initially, I can only imagine that 1003 messages are being published.
> If you can confirm that's not the case, then we'll have to look
> elsewhere.
>
> 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