![]() ![]() For example, if you have an emails-staging.fifo queue and an emails-production.fifo queue, you can set the suffix config to -staging or -production based on the environment, and your code can continue to use emails.fifo without needing to know the environment. The suffix config option is used to support queues for different environments without having to specify the environment suffix when using the queue. This is needed for some specific environments, such as AWS Lambda. The 'token' => env('AWS_SESSION_TOKEN'), config option may be added if you need to specify an AWS STS temporary session token in the config. More information about alternative options is available in the AWS PHP SDK guide here. The key and secret config options may be omitted if using one of the alternative options for providing AWS credentials (e.g. ( new LaravelSqsFifoQueueServiceProvider( $app))-> register() Credentials $app-> instance( 'queue', $queue-> getQueueManager()) ![]() Register the 'queue' alias in the Container, then register the SQS FIFO provider. Make this Capsule instance available globally via static methods. 'key' => 'your-public-key', // ex: ABCDEFGHIJKLMNOPQRST 'secret' => 'your-secret-key', // ex: 1a23bc/deFgHijKl4mNOp5qrS6TUVwXyz7ABCDef 'prefix' => 'your-prefix', // ex: 'queue' => 'your-queue-name', // ex: queuename.fifo 'suffix' => 'your-suffix', // ex: -staging 'region' => 'your-queue-region', // ex: us-east-1 'after_commit' => false, Use ShiftOneLabs\ LaravelSqsFifoQueue\ LaravelSqsFifoQueueServiceProvider If using the illuminate\queue component Capsule outside of Lumen/Laravel: use Illuminate\ Queue\ Capsule\ Manager as Queue If you'd like this to be the default connection, also set QUEUE_CONNECTION=sqs-fifo in the. ![]() env file: AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRSTĪWS_SECRET_ACCESS_KEY=1a23bc/deFgHijKl4mNOp5qrS6TUVwXyz7ABCDef 'allow_delay' => env('SQS_FIFO_ALLOW_DELAY', false),Įxample. 'deduplicator' => env('SQS_FIFO_DEDUPLICATOR', 'unique'), 'queue' => env('SQS_FIFO_QUEUE', 'default.fifo'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), Now, for both Laravel and Lumen, open config/queue.php and add the following entry to the connections array. Next, copy vendor/laravel/lumen-framework/config/queue.php to config/queue.php. If using Lumen, create a config directory in your project root if you don't already have one. Open bootstrap/app.php and add following line under the "Register Service Providers" section: $app-> register( ShiftOneLabs\ LaravelSqsFifoQueue\ LaravelSqsFifoQueueServiceProvider::class) Configuration Laravel/Lumen 9.x, 10.x The service provider will automatically be registered. This package uses auto package discovery. Once composer has been updated and the package has been installed, the service provider will need to be loaded. Via Composer $ composer require shiftonelabs/laravel-sqs-fifo-queue ![]() For Laravel 4.1 through Laravel 8.x, view the 2.x branch. This readme has been updated to show information for the most currently supported versions (9.x - 10.x). This section will be updated to reflect the versions on which the package has actually been tested. This package has been tested on Laravel 4.1 through Laravel 10.x, though it may continue to work on later versions as they are released. While Laravel works with Amazon's SQS standard queues out of the box, FIFO queues are slightly different and are not handled properly by Laravel. This Laravel/Lumen package provides a queue driver for Amazon's SQS FIFO queues. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |