connection = pika.BlockingConnection(pika_conn_params)
channel = connection.channel()
queue = channel.queue_declare(queue='your_queue', durable=True, exclusive=
    False, auto_delete=False)
print(queue.method.message_count)
Getting number of messages in a RabbitMQ queue