Closed
Description
I know it's possible to bind certain handlers to a specific transport but that only works when the handler implements MessageSubscriberInterface
.
In my case, I use autowire to automatically tag my handlers. I split my handlers in 2 directories like this:
src/Handler/Asynchronous
src/Handler/Synchronous
And then register them using:
App\Handler\Asynchronous\:
resource: 'src/Domain/Handler/Asynchronous'
tags: [{ name: 'messenger.message_handler', bus: 'command.bus' }]
App\Handler\Synchronous\:
resource: 'src/Domain/Handler/Synchronous'
tags: [{ name: 'messenger.message_handler', bus: 'command.bus' }]
It would be great if I could add transport: async
and transport: sync
to automatically select the transport for the given handlers:
App\Handler\Asynchronous\:
resource: 'src/Domain/Handler/Asynchronous'
tags: [{ name: 'messenger.message_handler', bus: 'command.bus', transport: 'async' }]
App\Handler\Synchronous\:
resource: 'src/Domain/Handler/Synchronous'
tags: [{ name: 'messenger.message_handler', bus: 'command.bus', transport: 'sync' }]