Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate settings for each queue #89

Open
nilpoona opened this issue Nov 14, 2022 · 7 comments
Open

Separate settings for each queue #89

nilpoona opened this issue Nov 14, 2022 · 7 comments
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue

Comments

@nilpoona
Copy link
Contributor

Are there any plans to make it possible to configure SQS Active Job settings on a per queue basis, as shown below?

queue1:
  max_messages: 10
  visibility_timeout: 30
queue2:
  max_messages: 5
  visibility_timeout: 100
@alextwoods
Copy link
Contributor

alextwoods commented Nov 15, 2022

Since the poller currently runs independently per queue, it would be relatively straightforward to accept per queue configuration. I'll mark this as a feature request and we'd be happy to take a PR for it.

In the mean time - when running workers you can specify the max_messages and visibility_timeout per queue via arguments, eg: RAILS_ENV=development bundle exec aws_sqs_active_job --queue default --max_messages 5 --visibility_timeout 100 (run bundle exec aws_sqs_active_job --help for a complete list of arguments).

@alextwoods alextwoods added the feature-request A feature should be added or improved. label Nov 15, 2022
@nilpoona
Copy link
Contributor Author

Thanks. I will send you a PR later.
In the meantime, I will try to deal with the method you suggested of specifying the poller argument directly.

@mullermp
Copy link
Contributor

@nilpoona We are looking to do a minor release of this gem soon. Did you still intend to send a PR for this?

@nilpoona
Copy link
Contributor Author

nilpoona commented Nov 22, 2022

@mullermp
We did not intend to make it in time for that release. We are not in a hurry.

@RanVaknin RanVaknin added the p3 This is a minor priority issue label Jul 31, 2024
@januszm
Copy link

januszm commented Nov 6, 2024

Any chance to have the poller poll from all queues from the config file? That would mimic the behaviour of Sidekiq/Shoryuken task queues that are widely adopted already. I would rather avoid having to run multiple pollers just to poll from different queues, and instead run a single background process.

@mullermp
Copy link
Contributor

mullermp commented Nov 6, 2024

@januszm Can you be more specific about your use case and why you need a single process for multiple queues, rather than one queue and only one process? Managing multiple processes outside of the ruby environment (and out of ruby code) reduces a large amount of complexity and is more performant.

@januszm
Copy link

januszm commented Nov 6, 2024

@mullermp it seems to me that this is the simplest use case you can imagine, i.e. we want to have one Worker tier, which is easier to manage, and this worker tier is supposed to process tasks from the default queue + possibly a few other optional queues. I know that it is better to have more worker tiers if the tasks require completely different servers, e.g. CPU intensive and those that require a lot of RAM. But for most simple tasks, one is enough. Use case: I have a separate team in the company that has its own SNS topic to which it sends tasks to be executed by my system. I would like to have the possibility for my worker tier to also process messages from the queue subscribed to this SNS topic, so I would add it to config/aws_sqs_active_job.yml and expect that one poller will also handle this additional queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

5 participants