Package

Shiftonelabs Laravel Sqs Fifo Queue

Adds a Laravel queue driver for Amazon SQS FIFO queues.

Package

shiftonelabs/laravel-sqs-fifo-queue

View on GitHub →

Summary of Laravel SQS FIFO Queue Package

The laravel-sqs-fifo-queue package provides a specialized queue driver for handling Amazon SQS FIFO (First In, First Out) queues within Laravel and Lumen applications. Unlike standard SQS queues, FIFO queues ensure that messages are processed exactly once and in the order they are sent. This package seamlessly integrates these queues into the Laravel framework, which natively supports only standard SQS queues.

Key Features

  • SQS FIFO Support: Enables the use of SQS FIFO queues, which are not natively supported by Laravel.
  • Message Grouping: Supports multiple message groups within a single FIFO queue to optimize performance and order.
  • Deduplication Configuration: Offers configurable deduplication strategies (unique, content, or relying on SQS's built-in capabilities).
  • Environment Specific Suffix: Allows dynamic queue naming based on the environment, aiding simpler configuration across development, staging, and production.
  • Transaction-aware Dispatching: Option to delay job dispatch until after database transactions commit, ensuring data consistency.
  • Integration with Laravel Job Batching: Ensures FIFO queue compatibility with Laravel's job batching features.

Installation and Configuration

Install via Composer:

composer require shiftonelabs/laravel-sqs-fifo-queue

For Laravel, no additional service provider registration is needed due to package auto-discovery. For Lumen, manual registration is required in bootstrap/app.php.

Configuration involves setting up the queue.php config file with appropriate credentials and queue details:

'sqs-fifo' => [
    'driver' => 'sqs-fifo',
    'key' => env('AWS_ACCESS_KEY_ID'),
    'secret' => env('AWS_SECRET_ACCESS_KEY'),
    'prefix' => env('SQS_FIFO_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
    'queue' => env('SQS_FIFO_QUEUE', 'default.fifo'),
    'suffix' => env('SQS_FIFO_SUFFIX'),
    'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
    'group' => 'default',
    'deduplicator' => env('SQS_FIFO_DEDUPLICATOR', 'unique'),
    'allow_delay' => env('SQS_FIFO_ALLOW_DELAY', false),
],

Usage

Utilize the FIFO queue just like any standard Laravel queue. The package handles specifics such as message grouping and deduplication internally. Jobs can be dispatched to different message groups or use different deduplication strategies by using provided methods like onMessageGroup() and withDeduplicator().

Advanced Configuration

The package allows for advanced customization including per-job group settings, custom deduplication logic, and handling of delayed jobs in a FIFO context (note that FIFO supports only queue-wide delay settings).

Conclusion

The laravel-sqs-fifo-queue package is an essential tool for developers needing reliable and ordered processing of jobs in a Laravel application, leveraging the advanced features of Amazon SQS FIFO queues. It simplifies integration and usage while providing powerful options for performance tuning and customization.

Shiftonelabs Laravel Sqs Fifo Queue Related Articles

Things I Didn't Know About SQS image

Things I Didn't Know About SQS

Read article
Using SQS FIFO Queues image

Using SQS FIFO Queues

Read article
Use Amazon's new Fair Queue Feature With SQS in Laravel 12.27 image

Use Amazon's new Fair Queue Feature With SQS in Laravel 12.27

Read article
Queue::forward(): Reroute Laravel Queues in One Place image

Queue::forward(): Reroute Laravel Queues in One Place

Read article
Laravel Jobs and Queue 101, building a simple analytics app image

Laravel Jobs and Queue 101, building a simple analytics app

Read article
Laravel Jobs and Queue 101: queue connections, using multiple queues, and setting up priorities image

Laravel Jobs and Queue 101: queue connections, using multiple queues, and setting up priorities

Read article

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift