macpaw / symfony-messenger-bundle
A Symfony bundle to extend Symfony Messenger Component
Installs: 4 198
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 14
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.3
- doctrine/orm: ^2.17 || ^3.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/doctrine-bridge: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/messenger: ^6.4 || ^7.0
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: 3.7.*
This package is auto-updated.
Last update: 2024-11-05 14:46:06 UTC
README
The SymfonyMessengerBundle
offers a suite of middleware extensions designed to enhance the functionality of the Symfony Messenger component.
Installation
Use Composer to install the bundle:
composer require macpaw/symfony-messenger-bundle
Applications that don't use Symfony Flex
Enable the bundle by adding it to the list of registered bundles in config/bundles.php
// config/bundles.php
<?php
return [
Macpaw\SymfonyMessengerBundle\SymfonyMessengerBundle::class => ['all' => true],
// ...
];
Add middlewares to messenger component
See https://symfony.com/doc/current/messenger.html#messenger_middleware
config/packages/messenger.yaml
Example:
# config/packages/messenger.yaml
framework:
messenger:
buses:
messenger.bus.default:
# disable the default middleware
default_middleware: false
middleware:
# use and configure parts of the default middleware you want
- 'add_bus_name_stamp_middleware': ['messenger.bus.default']
# add your own services that implement Symfony\Component\Messenger\Middleware\MiddlewareInterface
- 'Macpaw\SymfonyMessengerBundle\Middleware\DoctrineTransactionMiddleware'