Laravel

How to Use Amazon FIFO SQS in Laravel queue?

I want to point out to others who might stumble across the same issue that, although editing SqsQueue.php works, it will easily be reset by a composer install or composer update. An alternative is to implement a new Illuminate\Queue\Connectors\ConnectorInterface for SQS FIFO then add it to Laravel’s queue manager.

My approach is as follows:

  1. Create a new SqsFifoQueue class that extends Illuminate\Queue\SqsQueue but supports SQS FIFO.
  2. Create a new SqsFifoConnector class that extends Illuminate\Queue\Connectors\SqsConnector that would establish a connection using SqsFifoQueue.
  3. Create a new SqsFifoServiceProvider that registers the SqsFifoConnector to Laravel’s queue manager.
  4. Add SqsFifoServiceProvider to your config/app.php.
  5. Update config/queue.php to use the new SQS FIFO Queue driver.

Example:

  1. Create a new SqsFifoQueue class that extends Illuminate\Queue\SqsQueue but supports SQS FIFO.
PHP

2. Create a new SqsFifoConnector class that extends Illuminate\Queue\Connectors\SqsConnector that would establish a connection using SqsFifoQueue.

PHP

3. Create a new SqsFifoServiceProvider that registers the SqsFifoConnector to Laravel’s queue manager.

PHP

4. Add SqsFifoServiceProvider to your config/app.php.

PHP

5. Update config/queue.php to use the new SQS FIFO Queue driver.

PHP

Then your queue should now support SQS FIFO Queues.

Shaiv Roy

Hy Myself shaiv roy, I am a passionate blogger and love to share ideas among people, I am having good experience with laravel, vue js, react, flutter and doing website and app development work from last 7 years.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also
Close
Back to top button