pccomponentes / messenger-retry-bundle
Symfony Messenger 中的重试策略的 Symfony Bundle
v2.0.1
2023-06-29 10:02 UTC
Requires
- php: ^8.0
- pccomponentes/ddd: ^4.0
- symfony/framework-bundle: ^6.0
- symfony/messenger: ^6.0
Requires (Dev)
- dg/bypass-finals: ^1.4
- pccomponentes/coding-standard: ^2.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-11 05:43:54 UTC
README
这是一个 Bundle,可以添加根据要处理的邮件类型选择重试策略的功能。
注意:消息最终应继承自 Message.
安装
-
通过 composer 安装
composer require pccomponentes/messenger-retry-bundle
-
编写 Bundle 配置文件(
config/packages/messenger_retry.yaml
),指定每个消息类的重试策略以及在每个策略中要执行的操作。其内容示例:messenger_retry: - max_retries: 5 delay_milliseconds: 2000 multiplier: 2 max_delay_milliseconds: 2800000 msg_types: - PcComponentes\Ddd\Application\Command: auto # - PcComponentes\Ddd\Application\Command: always_retry # - PcComponentes\Ddd\Application\Command: never_retry
此文件将被修改,以添加或删除项目所需的所有重试策略。