npo / amazon-sqs-messenger-bundle
Symfony Amazon SQS 扩展 Messenger Bridge
2.5
2024-01-31 12:31 UTC
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
此包可用于在消息拒绝或发送时对处理方式有更多控制(例如启用服务器端拒绝,查找以下页面以获取更多信息https://symfony.com.cn/doc/current/messenger.html#retries-failures)。默认情况下,所有不可恢复的消息处理异常将不会被发送和拒绝。行为由IMessageReceiverEvaluator
和IMessageSenderEvaluator
服务控制,这些服务可以根据需要重写。
安装
composer require npo/amazon-sqs-messenger-bundle
使用方法
添加到 config/bundles.php
AsyncAws\Symfony\Bundle\AsyncAwsBundle::class => ['all' => true],
NpoMessage\AmazonSqsMessenger\AmazonSqsMessengerBundle::class => ['all' => true],
MoveSqsMessagesCommand
该命令可用于将消息从一个队列移动到另一个队列(例如,从fifo DLQ重发消息)
使用方法
bin/console npo-amazon-sqs-messenger:sqs:move-messages --from "https://from-queue-url" --to "https://to-queue-url"
IMoveSqsMessagesMiddleWare
默认情况下,MoveSqsMessagesMiddleWare会过滤掉所有没有收据处理的消息,因为这需要从队列中删除消息。如果您想在消息移动之前执行一些额外的业务逻辑,您可以重写IMoveSqsMessagesMiddleWare
并将其手动注入。