0

I am trying to set up multiple queues in my queue.php in laravel.

Documentation found specifies how to set up a queue, and talks about multiple queues, but does not specify how to set them up in queue.php

  'sqs-fifo' => [
        'driver' => 'sqs-fifo',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'prefix' => env('SQS_PREFIX', 'myqueurl'),
        'queue' => env('SQS_QUEUE', 'queue1.fifo'),
        'suffix' => env('SQS_SUFFIX'),
        'region' => env('AWS_DEFAULT_REGION', 'ap-northeast-1'),
        'group' => 'default',
        'deduplicator' => 'unique'
    ],

Where do I specify the name of other queues?

1
  • that is a name right there 'sqs-fifo' ... the keys of the 'connections' array are the names Commented Sep 23, 2020 at 22:36

1 Answer 1

2

Laravel documentation doesnt specify this, but if you have created multiple queues in Amazon SQS, for example:

queue1.fifo queue2.fifo queue3.fifo

You only need to configure your default queue in the queue.php file, and are free to queue jobs to the other queues that you have created in Amazon SQS simply by specifying their name. No need to add it to a config file.

Example:

ProcessMyJob::dispatch()->onQueue('queue2.fifo');

In the example above, you can see I am telling the job dispatching the "ProcessMyJob" Job, on a queue called 'queue2.fifo', that I have set up on Amazon SQS.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.