Fix RabbitAmqpAdmin.purgeQueue for proper return
The `Management.queuePurge()` now returns a `PurgeStatus` abstraction, where the `messageCount` property is what we expect on the `AmqpAdmin` contract. Related to: https://github.com/rabbitmq/rabbitmq-amqp-java-client/issues/151
This commit is contained in:
@@ -402,9 +402,8 @@ public class RabbitAmqpAdmin
|
||||
@ManagedOperation(description = "Purge a queue and return the number of messages purged")
|
||||
public int purgeQueue(String queueName) {
|
||||
try (Management management = getManagement()) {
|
||||
management.queuePurge(queueName);
|
||||
return (int) management.queuePurge(queueName).messageCount();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user