'Create a new queue specified by name.
If the queue already exists, no change is made to the queue,
and the return value returns information about the existing queue.
The queue name is required and specified as the first argument.
If passive is True, the server will not create the queue. The
client can use this to check whether a queue exists without
modifying the server state. Default is False.
If durable is True, the queue will be durable. Durable queues
remain active when a server restarts. Non-durable queues (
transient queues) are purged if/when a server restarts. Note that
durable queues do not necessarily hold persistent messages,
although it does not make sense to send persistent messages to a
transient queue. Default is False.
If exclusive is True, the queue will be exclusive. Exclusive queues
may only be consumed by the current connection. Setting the
\'exclusive\' flag always implies \'auto-delete\'. Default is False.
If auto_delete is True,  the queue is deleted when all consumers
have finished using it. The last consumer can be cancelled either
explicitly or because its channel is closed. If there was no
consumer ever on the queue, it won\'t be deleted. Default is True.
The nowait parameter is unused. It was part of the 0-9-1 protocol,
but this AMQP client implements 0-10 which removed the nowait option.
The arguments parameter is a set of arguments for the declaration of
the queue. Arguments are passed as a dict or None. This field is
ignored if passive is True. Default is None.
This method returns a :class:`~collections.namedtuple` with the name
\'queue_declare_ok_t\' and the queue name as \'queue\', message count
on the queue as \'message_count\', and the number of active consumers
as \'consumer_count\'. The named tuple values are ordered as queue,
message_count, and consumer_count respectively.
Due to Celery\'s non-ACKing of events, a ring policy is set on any
queue that starts with the string \'celeryev\' or ends with the string
\'pidbox\'. These are celery event queues, and Celery does not ack
them, causing the messages to build-up. Eventually Qpid stops serving
messages unless the \'ring\' policy is set, at which point the buffer
backing the queue becomes circular.
:param queue: The name of the queue to be created.
:type queue: str
:param passive: If True, the sever will not create the queue.
:type passive: bool
:param durable: If True, the queue will be durable.
:type durable: bool
:param exclusive: If True, the queue will be exclusive.
:type exclusive: bool
:param auto_delete: If True, the queue is deleted when all
consumers have finished using it.
:type auto_delete: bool
:param nowait: This parameter is unused since the 0-10
specification does not include it.
:type nowait: bool
:param arguments: A set of arguments for the declaration of the
queue.
:type arguments: dict or None
:return: A named tuple representing the declared queue as a named
tuple. The tuple values are ordered as queue, message count,
and the active consumer count.
:rtype: :class:`~collections.namedtuple`'

def queue_declare(self, queue, passive=False, durable=False, exclusive=False, auto_delete=True, nowait=False, arguments=None):

    options = {u'passive': passive, u'durable': durable, u'exclusive': exclusive, u'auto-delete': auto_delete, u'arguments': arguments}
    if (queue.startswith(u'celeryev') or queue.endswith(u'pidbox')):
        options[u'qpid.policy_type'] = u'ring'
    try:
        self._broker.addQueue(queue, options=options)
    except Exception as exc:
        if (OBJECT_ALREADY_EXISTS_STRING not in str(exc)):
            raise exc
    queue_to_check = self._broker.getQueue(queue)
    message_count = queue_to_check.values[u'msgDepth']
    consumer_count = queue_to_check.values[u'consumerCount']
    return amqp.protocol.queue_declare_ok_t(queue, message_count, consumer_count)
