componenta / cqrs-retry
Retry middleware for Componenta CQRS commands
v2.0.0
2026-08-08 15:42 UTC
Requires
- php: >=8.4
- componenta/config: ^2.0
- componenta/cqrs: ^2.0
- psr/container: ^2.0
Requires (Dev)
- pestphp/pest: ^4.0
- phpstan/phpstan: ^2.0
README
Retry middleware package for componenta/cqrs commands marked with #[Componenta\CQRS\Retry\Attribute\Retry].
composer require componenta/cqrs-retry
Register the provider and add RetryMiddleware to the command middleware chain where the application needs retry behavior.
return [ new Componenta\CQRS\ConfigProvider(), new Componenta\CQRS\Retry\ConfigProvider(), ];
The provider registers Componenta\CQRS\Retry\Attribute\Retry in ConfigKey::COMMAND_METADATA_ATTRIBUTES. With componenta/cqrs-app, its constructor arguments are compiled into the versioned map; the middleware reads them through CommandMetadataProviderInterface without hard-coded compiler support.
The package provides:
Componenta\CQRS\Command\Middleware\RetryMiddlewareComponenta\CQRS\Command\Exception\RetryableExceptionInterface