获取输出作为ConsumerGroupCommand.main()的字符串?

时间:2016-10-27 04:00:21

标签: java apache-kafka

我想使用ConsumerGroupCommand.main(new String[]{"--bootstrap-server","xxx:9092","--group","consumer3","--describe"});来获取偏移量度量,但方法的响应类型为void。只是控制台打印msg

如:

GROUP                          TOPIC                          PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             OWNER
consumer3                      ttest                          1          5522143         5522143         0               localhost java2_/ip
consumer3                      ttest                          0          5392302         5392302         0               localhost java new_/ip

我如何以string收到回复?

0 个答案:

没有答案