Created
September 11, 2019 22:40
-
-
Save mareksuscak/548723e29256b9e5bf86388a9755d4dd to your computer and use it in GitHub Desktop.
Symfony 4.4 Messenger - Alternative approach to different middleware for producer and consumer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framework: | |
messenger: | |
# ... | |
# Read more to learn why there are two buses (TL;DR: different middleware on each side - producer and consumer) | |
# https://github.com/symfony/symfony/issues/32436#issuecomment-530565499 | |
default_bus: command.bus | |
buses: | |
command.bus: | |
default_middleware: false | |
middleware: | |
- validation | |
- add_bus_name_stamp_middleware: ['command.consumer.bus'] | |
- dispatch_after_current_bus | |
- failed_message_processing_middleware | |
- send_message | |
- handle_message | |
command.consumer.bus: | |
middleware: | |
- doctrine_ping_connection | |
# Will be available as of Symfony 4.4 | |
# - doctrine_clear_entity_manager | |
- doctrine_transaction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this!