Example usage for org.springframework.amqp.rabbit.core RabbitAdmin QUEUE_MESSAGE_COUNT

List of usage examples for org.springframework.amqp.rabbit.core RabbitAdmin QUEUE_MESSAGE_COUNT

Introduction

In this page you can find the example usage for org.springframework.amqp.rabbit.core RabbitAdmin QUEUE_MESSAGE_COUNT.

Prototype

Object QUEUE_MESSAGE_COUNT

To view the source code for org.springframework.amqp.rabbit.core RabbitAdmin QUEUE_MESSAGE_COUNT.

Click Source Link

Document

Property key for the message count in the Properties returned by #getQueueProperties(String) .

Usage

From source file:org.springframework.amqp.rabbit.core.RabbitAdminTests.java

private int messageCount(RabbitAdmin rabbitAdmin, String queueName) {
    Properties props = rabbitAdmin.getQueueProperties(queueName);
    assertNotNull(props);//  ww w .  j  a v  a2 s  .c  o  m
    assertNotNull(props.get(RabbitAdmin.QUEUE_MESSAGE_COUNT));
    return (Integer) props.get(RabbitAdmin.QUEUE_MESSAGE_COUNT);
}