Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7794925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:55:09+00:00 2026-06-01T22:55:09+00:00

we are currently planning a rails 3.2.2 application where we use RabbitMQ. We would

  • 0

we are currently planning a rails 3.2.2 application where we use RabbitMQ. We would like to run several kind of workers (and several instances of a worker) to process messages from different queues. The workers are written in ruby and are laying in the lib directory of the rails app.

Some of the workers needs the rails framework (active record, active model…) and some of them don’t. The first worker should be called every minute to check if updates are available. The other workers should process the messages from their queues when messages (which are send by the first worker) are present and do some (time consuming) stuff with it.

So far, so good. My problem is, that I only have little experiences with messaging systems like RabbitMQ and no experiences with the rails interaction between them. So I’m wondering what the best practices are to get the two playing with each other. Here are my requirements again:

  • Rails 3.2.2 app
  • RabbitMQ
  • Several kind of workers
  • Several instances of one worker
  • Control the amount of workers out of rails
  • Workers are doing time consuming tasks, so they have to be async
  • Only a few workers needs the rails framework. The others are just ruby files with some dependencies like Net or File

I was looking for some solution and came up with two possibilities:

Using amqp with EventMachine in a new thread

Of course, I don’t want my rails app to be blocked when a new worker is created. The worker should run in another thread and do its work asynchronously. And furthermore, it should not start a new instance of my rails application. It should only require the things the worker needs.

But in some articles they say that there are some issues with Passenger. And another fact that I don’t like is, that we are using webbrick for development and we ought to include workarounds for that too. It would be possible to switch to another webserver like thin, but I don’t have any experience with that either.

Using some kind of daemonizing

Maybe its possible to run workers as a daemon, but I don’t know how much overhead this would come up with, or how I can control the amount of workers.

Hope someone can advise a good solution for that (and I hope I made myself clear 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:55:11+00:00Added an answer on June 1, 2026 at 10:55 pm

    It seems to me that AMQP is a big shot to kill your problem. Have you tried to use Resque? The backed Redis database has some neat features (like publish/subscribe and blocking list pop) which make it very interesting as a message queue, and Resque is very easy to use in any Rails app.

    The workers are daemonized, and you decide which worker of your pool listens to which queue, so you can scale each type of job as needed.

    Using EM reactor inside a request/response cycle is not recommended, because it may conflict with an existing event loop (for instance if your app is served by thin), in any case you have to configure it specifically for your web server, OTOS it may be interesting to have an evented queue consumer, if your jobs have blocking IO and are not processor-bound.

    If you still want to do it with AMQP, see Starting the event loop and connecting in Web applications and configure for your web server accordingly. Or use bunny to push synchronously in the queue (and whichever job consumer you deam useflu, like workling for instance)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are currently planning an application and are looking to use Hibernate. The database
We're currently planning a new API for an application and debating the various data
I am currently planning to develop a music streaming application. And i am wondering
I'm currently in the planning stage for a web application and I find myself
What would the differences be in implementing remote business logic? Currently we are planning
I'm working on a Rails application and it is currently hosted on a shared
I am currently planning a web based application, which needs to do long calculations
I'm currently planning to use the Java networking library, Kryonet, for my game. I'm
I am building a DEV image and am currently planning to use Windows XP
I'm currently planning an application that does work on an object relational database. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.