0
votes

I use Rabbitmq with the Bunny gem to store messages that we want to send to customers. I have a Padrino-based web service that pushes messages to the queue and many workers that consume messages.

It works fine when I use Thin as the server, but I get an "execution expired" message from Bunny if I start the web-service in Apache/Passenger. I read there's a problem with EventMachine in Passenger, but Bunny doesn't use EventMachine, so it might be a different issue, although the behavior is very similar.

The exception is "execution expired", so it's waiting for a message that never arrives, so I guess there can be a callback issue, although the code is very simple. Bunny opens a channel to RabbitMQ, pushes the message and closes the channel, so there's no polling and doesn't call any callbacks.

The code in the service is:

client = Bunny.new
client.start
client.create_channel  # => throws exception, "execution expired"
...
1
Bunny might not use EventMachine, but it's sure using threads, which might be colliding the same way that EventMachine does.the Tin Man

1 Answers

1
votes

I found the problem. It was a Passenger issue, because I binded the client instance to the class and wanted to use the same connection over multiple requests. It worked in thin, but Passenger didn't like this solution.