Apache Kafka

how to write a kafka client?----

2018-01-04  本文已影响5人  loinliao

官方文档

Partitioning

Kafka clients directly control the assignment that how a particular piece of data is assigned to a particular partition.
These requests to publish or fetch data must be sent to the broker that is currently acting as the leader for a given partition.

  1. Cycle through a list of "bootstrap" kafka urls until we find one we can connect to. Fetch cluster metadata.
  2. Process fetch or produce requests, directing them to the appropriate broker based on the topic/partitions they send to or fetch from.
  3. If we get an appropriate error, refresh the metadata and try again.
上一篇下一篇

猜你喜欢

热点阅读