Closed
Description
I have separate buses like this:
# messenger.yaml
framework:
messenger:
default_bus: my.sender
buses:
my.sender:
default_middleware: false
middleware:
- messenger.middleware.send_message
my.receiver:
default_middleware: false
middleware:
- App\Middleware\MyMiddleware
transports:
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
retry_strategy:
max_retries: 999
delay: 10000
multiplier: 1
max_delay: 0
routing:
'*': async
I use command bin/console messenger:consume async --bus=my.receiver
.
So we have a retryEnvelope dispatch call that goes directly to the same receiver bus. Variable $bus comes from ConsumeMessagesCommand:
# ConsumeMessagesCommand.php
$bus = $this->busLocator->get($input->getOption('bus'));
# Worker.php
$this->bus->dispatch($retryEnvelope);
Since I have different buses (I strongly believe that one bus per send/receive ops is kind of workaround with "ifs"), I need an ability to somehow point to another bus. Is there any solution coming? Did I miss something?