npo / amazon-sqs-messenger-bundle
Symfony Amazon SQS extension Messenger Bridge
Requires
- php: ^8.3
- async-aws/async-aws-bundle: ^1.11
- async-aws/sns: ^1.4
- symfony/amazon-sqs-messenger: ^6.3 || ^7.0
- symfony/framework-bundle: ^6.3 || ^7.0
Requires (Dev)
- dg/bypass-finals: ^1.4.1
- friendsofphp/php-cs-fixer: ^3.22.0
- liip/test-fixtures-bundle: ^2.6.0
- mockery/mockery: ^1.6
- npo/phpunit-extension: ^1.0
- phpcompatibility/php-compatibility: ^9.3.5
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan: ^1.10.26
- phpstan/phpstan-phpunit: ^1.3.13
- phpstan/phpstan-symfony: ^1.3.2
- phpunit/phpunit: ^10.2.7
- squizlabs/php_codesniffer: ^3.7.2
- symfony/phpunit-bridge: ^6.3.2
README
This bundle can be used to take more control on how to handle messages upon rejection or sending (for example to enable server side rejection, lookup the following page https://symfony.com/doc/current/messenger.html#retries-failures for more information). By default all UnrecoverableMessageHandlingException will not be sent and rejected. The behavior is controlled by the IMessageReceiverEvaluator
and IMessageSenderEvaluator
services which can be overridden if needed.
Instal
composer require npo/amazon-sqs-messenger-bundle
Usage
Add to config/bundles.php
:
AsyncAws\Symfony\Bundle\AsyncAwsBundle::class => ['all' => true],
NpoMessage\AmazonSqsMessenger\AmazonSqsMessengerBundle::class => ['all' => true],
MoveSqsMessagesCommand
Command can be used to move messages from one queue to another queue (eg. to redrive messages from a fifo DLQ)
Usage
bin/console npo-amazon-sqs-messenger:sqs:move-messages --from "https://from-queue-url" --to "https://to-queue-url"
IMoveSqsMessagesMiddleWare
By default the MoveSqsMessagesMiddleWare filters all messages without a receipt handle, as this is needed to remove messages from a queue. If you want to do some additional business logic before messages are moved, you can overwrite the IMoveSqsMessagesMiddleWare
and manually inject it.