aws / aws-sdk-rails

Official repository for the aws-sdk-rails gem, which integrates the AWS SDK for Ruby with Ruby on Rails.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for forwarding Elastic Beanstalk SQS Daemon requests to Active Job

MrWellington opened this issue · comments

Hi everyone, just discovered this gem recently. So far has been a great productivity tool especially as someone new to Rails and AWS, appreciate the good work!

I am currently hosting an application via Elastic Beanstalk and using your Active Job queue adapter to send messages to SQS. To process the queue I'm looking to host the app in an EB worker environment. Those instances come with an SQS Daemon that retrieves messages and forwards them to localhost over HTTP. Instead of using the provided aws_sqs_active_job process to retrieve messages (which I believe would conflict with the daemon), I would like the ability to listen for messages from the daemon and forward them to the appropriate jobs.

The existing library Active Elastic Job provides this capability using a lightweight Rack middleware that is only added with the presence of a specific environment variable. However that gem is largely out of date (still requires version 2.x of the core SDK) and requires the use of their queuing backend as well (I'd rather use yours).

I thought the approach of using middleware to achieve this was sound, and for the time being I currently have a stripped-down version of that library running successfully in my source code. However I thought this could be a nice addition to the Rails SDK itself that others could benefit from. Is this an idea you would be willing to implement or accept contributions for?

Great to hear its been useful! We already support using AWS Lambda to process ActiveJobs and I believe this feature-request is very thematically similar and something we should support. I agree using rack middleware seems like a sound implementation, and should be fairly straightforward.

We'd be very happy to accept contributions for this. If you plan on implementing, let me know, otherwise, I'll add this to my backlog and implement in the next couple of weeks.

Glad to hear it, and thanks for the quick response!

Should have time to work on an implementation over the next few days, will try to send out a request soon and keep you posted one way or the other.