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

Listening to multiple SQS queue #50

Open
SarahTeoh opened this issue Dec 18, 2021 · 2 comments
Open

Listening to multiple SQS queue #50

SarahTeoh opened this issue Dec 18, 2021 · 2 comments

Comments

@SarahTeoh
Copy link

In the README, you mentioned that the config matches SQS queues with handler classes.

return [
    'handlers' => [
        'base-integrations-updates' => App\Jobs\HandlerJob::class,
    ],

    'default-handler' => App\Jobs\HandlerJob::class
];

However, in the config/queue.php example, you only specify one queue prefix.

        ...
        'sqs-plain' => [
            'driver' => 'sqs-plain',
            'key'    => env('AWS_KEY', ''),
            'secret' => env('AWS_SECRET', ''),
            'prefix' => 'https://sqs.ap-southeast-2.amazonaws.com/123123/',   // <-- only 1 queue prefix
            'queue'  => 'important-music-updates',
            'region' => 'ap-southeast-2',
        ],
        ...

How to listen to multiple SQS queues? Do I need to write extra configuration to listen to multiple queues?

@dusterio
Copy link
Owner

Just add a sqs-plain2 driver in the config?

@hotaru-ishibashi
Copy link

specify comma-separated queue 'name' in command like below

php artisan queue:work sqs-plain --queue=high-priority-queue,low-priority-queue

'name' is just queue name of SQS(after prefix).
and you don't have to define name in config(config is just default value)

if you want to listen to multiple queue across prefix (across region), maybe you cannot do it in one command.
so you need to define another driver, and manage priority yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants