Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does kafka save the consumption location on the consumer side?

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "how to save the consumption location of the consumer side of kafka". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

In kafka, a built-in topic for _ _ consumer_ offsets_* is provided

_ _ consumer_offsets default partition 50

Create a consumer_offsets_group consumer group that ID will use later

Math.abs ("consumer_offsets_group" .hashCode ()) 50

As a result, it was put on section 11.

It can be obtained by the following formula:

View the consumer group offsets:

Bin/kafka-console-consumer.sh-topic _ consumer_offsets-partition 11-bootstrap-server localhost:9092-formatter "kafka.coordinator.group.GroupMetadataManager\ $OffsetsMessageFormatter"-consumer.config config/consumer.properties-from-beginning

Results:

[consumer_offsets_group/* consumer group ID*/,consumer_offsets_test/*topic*/,1/*partition*/]:: OffsetAndMetadata (consumption shift information submitted by offset=4/* * /, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567461031, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,0]: OffsetAndMetadata (offset=3, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567461031, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,2]: OffsetAndMetadata (offset=4, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567461031, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,1]: OffsetAndMetadata (offset=4, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567466027, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,0]: OffsetAndMetadata (offset=3, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567466027, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,2]: OffsetAndMetadata (offset=4, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567466027, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,1]: OffsetAndMetadata (offset=4, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567468638, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,0]: OffsetAndMetadata (offset=3, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567468638, expireTimestamp=None)

[consumer_offsets_group,consumer_offsets_test,2]: OffsetAndMetadata (offset=4, leaderEpoch=Optional.empty, metadata=, commitTimestamp=1543567468638, expireTimestamp=None)

This is the end of the content of "how to preserve the consumption location of the consumer side of kafka". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report