Search code examples
ruby-on-rails-3amqpresque

Accessing AMQP connection from Resque worker when using Thin as Web Server


trying to work past an issue when using a resque job to process inbound AMQP messages.

am using an initializer to set up the message consumer at application startup and then feed the received messages to resque job for processing. that is working quite well.

however, i also want to process a response message out of the worker, i.e. publish it back out to a queue, and am running into the issue of the forking process making the app-wide AMQP connection unaddressable from inside the resque worker. would be very interested to see how other folks have tackled this as i can't believe this pattern is unusual.

due to message volumes, taking the approach of firing up a new thread and amqp connection for every response is not a workable solution.

ideas?


Solution

  • my bust on this, had my eye off the ball and forgot about resque forking when it kicks off a worker. going to go the route suggested by others of daemonizing the process instead....