我有一个带有 Spring AMQP 的 Spring Boot 应用程序。如果我调用 /prometheus
我会得到所有指标,包括 rabbitmq_rejected_total
。 rabbitmq_rejected_total 是什么意思?
输出
[...]
# HELP rabbitmq_rejected_total
# TYPE rabbitmq_rejected_total counter
rabbitmq_rejected_total{application="test-service",name="rabbit",} 0.0
[...]
问题
rabbitmq_rejected_total
是否意味着拒绝并重新排队(ImmediateRequeueAmqpException
)?或者,这是否意味着被拒绝并且不重新排队(AmqpRejectAndDontRequeueException
)?
另请参阅否定确认:
AMQP 0-9-1 规范定义了 basic.reject
方法,允许客户端拒绝单个已传递的消息,指示代理丢弃它们或重新排队它们。
研究
我读了Spring AMQP,但我找不到任何有关指标的文档。
我阅读了 Spring Boot 参考文档< /a>,但我找不到有关此指标的任何文档。
I have a Spring Boot application with Spring AMQP. If I call /prometheus
I get all metrics including rabbitmq_rejected_total
. What does rabbitmq_rejected_total
mean?
Output
[...]
# HELP rabbitmq_rejected_total
# TYPE rabbitmq_rejected_total counter
rabbitmq_rejected_total{application="test-service",name="rabbit",} 0.0
[...]
Question
Does rabbitmq_rejected_total
mean rejected and requeued (ImmediateRequeueAmqpException
)? Or, does it mean rejected and not requeued (AmqpRejectAndDontRequeueException
)?
See also Negative Acknowledgements:
The AMQP 0-9-1 specification defines the basic.reject
method that allows clients to reject individual, delivered messages, instructing the broker to either discard them or requeue them.
Research
I read Spring AMQP, but I could not find any documentation about metrics.
I read Spring Boot Reference Documentation, but I could not find any documentation about this metric.
发布评论
评论(1)
Spring AMQP 维护的唯一指标是侦听器指标
https:// /docs.spring.io/spring-amqp/docs/current/reference/html/#micrometer
即监听器在处理消息时的执行方式。
这里描述了 RabbitMQ amqp-client 维护的指标 https://blog.rabbitmq.com/posts/2018/04/rabbitmq-java-client-metrics-with-micrometer-and-datadog/
如果您对这些指标有疑问,我建议您在rabbitmq-users Google 群组上询问。
我的猜测是,这是对被拒绝的消息数量的计数(在 Spring AMQP 术语中,当侦听器抛出异常时)。被拒绝的消息可能会被重新排队并重新传送,或者被丢弃(可以选择发送到 DLQ)。
The only metrics maintained by Spring AMQP are listener metrics
https://docs.spring.io/spring-amqp/docs/current/reference/html/#micrometer
i.e. how your listener performs when processing messages.
Metrics maintained by the RabbitMQ amqp-client are described here https://blog.rabbitmq.com/posts/2018/04/rabbitmq-java-client-metrics-with-micrometer-and-datadog/
If you have questions about those metrics, I suggest you ask on the rabbitmq-users Google group.
My guess is this one is a count of how many messages were rejected (in Spring AMQP terms, when the listener throws an exception). Rejected messages may be requeued and redelivered, or discarded (optionally being sent to a DLQ).