- How can I get the partition the consumer is connected to?
- If it is subscribed to multiple topics, How to get metrics (incoming-byte-rate) for different topics from
consumer.metrics()
?
- If you are part of a consumer group and are leveraging on the auto partitions assignment, every time partitions are assigned (due to a rebalance), the onPartitionsAssigned() (of the ConsumerRebalanceListener) is called with the collection of the assigned partitions. Btw in any moment you can call the assignment() method to get the assigned partitions.
- not quite sure but yes, the method metrics() should do the work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.