cserwen opened a new issue #95:
URL: https://github.com/apache/rocketmq-exporter/issues/95


   **Describe the bug**
   When the consumer is closed, the `countOfOnlineConsumers` of metrhc: 
`rocketmq_group_diff` won't be changed to 0.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Start a consumer and running for a while.
   2. Shutdown it and you will see the value of `countOfOnlineConsumers` still 
is 1.
   
   **Expected behavior**
   The value of `countOfOnlineConsumers` should be 0.
   
   **Screenshots**
   
   
   **Additional context**
   The root cause is that the following code.
   
https://github.com/apache/rocketmq-exporter/blob/85cf9058b9df3cc756562f59f3d27bd6efa9b8b0/src/main/java/org/apache/rocketmq/exporter/model/metrics/ConsumerTopicDiffMetric.java#L65
   The class `ConsumerTopicDiffMetric` has four fields:
   ```java
   private String group;
   private String topic;
   private String countOfOnlineConsumers;
   private String msgModel; //0:broadcast, 1:cluster
   ```
   It only calculates `topic` abd `group`. So when countOfOnlineConsumers 
changed, The new key will not be added. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to