code: def declare_queue(self, queue_name):
          
          attempts = 1
          while True:
              try:
                  if queue_name not in self.queues:
                      self.emit_before("declare_queue", queue_name)
                      self._declare_queue(queue_name)
                      self.queues.add(queue_name)
                      self.emit_after("declare_queue", queue_name)
  
                      delayed_name = dq_name(queue_name)
                      self._declare_dq_queue(queue_name)
                      self.delay_queues.add(delayed_name)
                      self.emit_after("declare_delay_queue", delayed_name)
  
                      self._declare_xq_queue(queue_name)
                  break
              except (pika.exceptions.AMQPConnectionError,
                      pika.exceptions.AMQPChannelError) as e:  # pragma: no cover
                  # Delete the channel and the connection so that the next
                  # caller may initiate new ones of each.
                  del self.channel
                  del self.connection
  
                  attempts += 1
                  if attempts > MAX_DECLARE_ATTEMPTS:
                      raise ConnectionClosed(e) from None
  
                  self.logger.debug(
                      "Retrying declare due to closed connection. [%d/%d]",
                      attempts, MAX_DECLARE_ATTEMPTS,
                  )
docs: Declare a queue.  Has no effect if a queue with the given
          name already exists.
  
          Parameters:
            queue_name(str): The name of the new queue.
  
          Raises:
            ConnectionClosed: If the underlying channel or connection
              has been closed.