You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2023/05/08 05:51:07 UTC

[GitHub] [rocketmq] kylehz created a discussion: ExamineConsumeStats这个API返回数据的问题

GitHub user kylehz created a discussion: ExamineConsumeStats这个API返回数据的问题

查询rocketmq的admin api,ExamineConsumeStats

rocketmq返回的内容:

```
{"consumeTps":0.0,"offsetTable":{{"brokerName":"broker-a","queueId":7,"topic":"evidence-sync-cloud"}:{"brokerOffset":0,"consumerOffset":0,"lastTimestamp":0}}}
```

可以看到在offsetTable里面的数据并不是标准的json。

查看了rocketmq的源码,发现定义的是一个以MessageQueue为key的HashMap:

```
private HashMap<MessageQueue, OffsetWrapper> offsetTable = new HashMap();
```

这样的非标准的json返回数据给golang解析带来了很大困扰,请问下怎么处理这样的数据

GitHub link: https://github.com/apache/rocketmq/discussions/6718

----
This is an automatically sent email for dev@rocketmq.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@rocketmq.apache.org


[GitHub] [rocketmq] echooymxq added a comment to the discussion: ExamineConsumeStats这个API返回数据的问题

Posted by GitBox <gi...@apache.org>.
GitHub user echooymxq added a comment to the discussion: ExamineConsumeStats这个API返回数据的问题

可以用正则表达式取每一对{"brokerName":"broker-a","queueId":7,"topic":"evidence-sync-cloud"}:{"brokerOffset":0,"consumerOffset":0,"lastTimestamp":0}这样的数据,然后单独反序列化具体每一对数据。

GitHub link: https://github.com/apache/rocketmq/discussions/6718#discussioncomment-5837780

----
This is an automatically sent email for dev@rocketmq.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@rocketmq.apache.org