/** @var BusNameStamp|null $busNameStamp */
$busNameStamp =
$envelope->
last(BusNameStamp::
class);
if (null ===
$busNameStamp) { if (null ===
$this->fallbackBus
) { throw new InvalidArgumentException('Envelope is missing a BusNameStamp and no fallback message bus is configured on RoutableMessageBus.'
);
} return $this->fallbackBus->
dispatch($envelope,
$stamps);
} return $this->
getMessageBus($busNameStamp->
getBusName())->
dispatch($envelope,
$stamps);
} /**
* @internal
*/
public function getMessageBus(string
$busName): MessageBusInterface
{ if (!
$this->busLocator->
has($busName)) { throw new InvalidArgumentException(sprintf('Bus named "%s" does not exist.',
$busName));
}