getHandlerDescriptor example

$this->logger?->info('Message {class} handled by {handler}', $context + ['handler' => $handledStamp->getHandlerName()]);
            } catch (\Throwable $e) {
                $exceptions[] = $e;
            }
        }

        /** @var FlushBatchHandlersStamp $flushStamp */
        if ($flushStamp = $envelope->last(FlushBatchHandlersStamp::class)) {
            /** @var NoAutoAckStamp $stamp */
            foreach ($envelope->all(NoAutoAckStamp::class) as $stamp) {
                try {
                    $handler = $stamp->getHandlerDescriptor()->getBatchHandler();
                    $handler->flush($flushStamp->force());
                } catch (\Throwable $e) {
                    $exceptions[] = $e;
                }
            }
        }

        if (null === $handler && !$alreadyHandled) {
            if (!$this->allowNoHandlers) {
                throw new NoHandlerForMessageException(sprintf('No handler for message "%s".', $context['class']));
            }

            
try {
            $e = null;
            $envelope = $this->bus->dispatch($envelope->with(new ReceivedStamp($transportName)new ConsumedByWorkerStamp()new AckStamp($ack)));
        } catch (\Throwable $e) {
        }

        $noAutoAckStamp = $envelope->last(NoAutoAckStamp::class);

        if (!$acked && !$noAutoAckStamp) {
            $this->acks[] = [$transportName$envelope$e];
        } elseif ($noAutoAckStamp) {
            $this->unacks[$noAutoAckStamp->getHandlerDescriptor()->getBatchHandler()] = [$envelope->withoutAll(AckStamp::class)$transportName];
        }

        $this->ack();
    }

    private function ack(): bool
    {
        $acks = $this->acks;
        $this->acks = [];

        foreach ($acks as [$transportName$envelope$e]) {
            
Home | Imprint | This part of the site doesn't use cookies.