我可以从AmqpReceiver中打印出入队消息,但是如何从队列中出队或清除消息呢?
amqpClient.createReceiver("my-queue",
done -> {
if (done.failed()) {
done.cause().printStackTrace();
System.out.println("Unable to create receiver");
} else {
final AmqpReceiver receiver = done.result();
receiver.address();
receiver
.exceptionHandler(t -> {
t.printStackTrace();
})
.handler(msg -> {
System.out.println("Message: " + msg.bodyAsJsonObject().toString());
});
receiver.connection().close(ar -> {
});
}
}
);