private function createDelayQueue(int $delay, ?string $routingKey)
    {
        $queue = $this->amqpFactory->createQueue($this->channel());
        $queue->setName(str_replace('%delay%', $delay, $this->connectionOptions['delay']['queue_name_pattern']));
        $queue->setArguments([
            'x-message-ttl' => $delay,
            'x-dead-letter-exchange' => $this->exchange()->getName(),
        ]);

        $routingKey = $routingKey ?? $this->getDefaultPublishRoutingKey();
        if (null !== $routingKey) {
            // after being released from to DLX, this routing key will be used
            $queue->setArgument('x-dead-letter-routing-key', $routingKey);
        }

        return $queue;
    }