'alias' => 'handler_that_works1',
]),
new HandlerDescriptor($transport2HandlerThatWorks,
[ 'from_transport' => 'transport2',
'alias' => 'handler_that_works2',
]),
],
]);
$dispatcher =
new EventDispatcher();
$bus =
new MessageBus([ new FailedMessageProcessingMiddleware(),
new SendMessageMiddleware($senderLocator),
new HandleMessageMiddleware($handlerLocator),
]);
$dispatcher->
addSubscriber(new AddErrorDetailsStampListener());
$dispatcher->
addSubscriber(new SendFailedMessageForRetryListener($locator,
$retryStrategyLocator));
$dispatcher->
addSubscriber(new SendFailedMessageToFailureTransportListener($sendersLocatorFailureTransport));
$dispatcher->
addSubscriber(new StopWorkerOnMessageLimitListener(1
));
$runWorker =
function Dstring
$transportName) use ($transports,
$bus,
$dispatcher): ?\Throwable
{ $throwable = null;