waitForConfirm example

$this->lastActivityTime = time();

        $exchange->publish(
            $body,
            $routingKey,
            $amqpStamp ? $amqpStamp->getFlags() : \AMQP_NOPARAM,
            $attributes
        );

        if ('' !== ($this->connectionOptions['confirm_timeout'] ?? '')) {
            $this->channel()->waitForConfirm((float) $this->connectionOptions['confirm_timeout']);
        }
    }

    private function setupDelay(int $delay, ?string $routingKey, bool $isRetryAttempt): void
    {
        if ($this->autoSetupDelayExchange) {
            $this->setupDelayExchange();
        }

        $queue = $this->createDelayQueue($delay$routingKey$isRetryAttempt);
        $queue->declareQueue(); // the delay queue always need to be declared because the name is dynamic and cannot be declared in advance
Home | Imprint | This part of the site doesn't use cookies.