-
Notifications
You must be signed in to change notification settings - Fork 64
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
How can I setup multiple queues in 1 application? #62
Comments
I think you would have to create a new queue connection in And then:
|
@mnapoli Could you tell why this implementation does not work? I'm dynamically getting the queue name through the event variable. It doesn't show any error, but also the message is not sent to the queue.
References: Would you help me? |
Did you figure this out? I haven't tested this but you should be able to put an environment variable per handler. constructs:
primary-queue:
type: queue
worker:
handler: Bref\LaravelBridge\Queue\QueueHandler
runtime: php-81
timeout: 60 # seconds
environment:
QUEUE_HANDLE_CONNECTION: primary
secondary-queue:
type: queue
worker:
handler: Bref\LaravelBridge\Queue\QueueHandler
runtime: php-81
timeout: 60 # seconds
environment:
QUEUE_HANDLE_CONNECTION: secondary Then override your the existing service provider definition of $connection, in your own AppServiceProvider. $this->app->when(QueueHandler::class)
->needs('$connection')
->give(env('QUEUE_HANDLE_CONNECTION')); Ideally this would all be magically resolved by QueueHandler instead based on the Job Queue ARN itself. I'll see if I can put together a PR later. |
When I setup single queue, it works like a charm. But if I want to have multiple queues, since we can only specify one queue url in
SQS_QUEUE
I don't know how to setup.The reason why I want multiple queues in 1 application is that I want to know if a specific job is still processing. To do that I separate queues for each jobs and long polling the status of queue.
The text was updated successfully, but these errors were encountered: