Browse Source

06: advanced configuration and API.

Frederic G. MARAND 3 years ago
parent
commit
565204cedb
1 changed files with 24 additions and 0 deletions
  1. 24 0
      docs/06 Consuming messages.md

+ 24 - 0
docs/06 Consuming messages.md

@@ -224,3 +224,27 @@ to partitions.
 - If a new partition becomes available, or a consumer fails, or is added,
   the Group Coordinator initiates the rebalancing protocol, engaging each Consumer coordinator
 
+## Consumer configuration: performance and efficiency
+
+- `fetch.min.bytes` : minimum number of bytes returned from the poll. Analogous
+  to the `batch.size` settings on the producer
+- `max.fetch.wait.ms` maximum time to wait if that threshold has not yet been met.
+  Analogous to the `linger.ms` setting on the producer
+- `max.partition.fetch.bytes`: maximum number of bytes per partition returned in a
+  `poll()` call, to avoid spending too much time on processing before calling
+  `poll()` again.
+- `max.poll.records` similar but in terms of records, not bytes, and not per partition
+
+## Advanced topics not covered
+
+- Consumer position control
+    - `seek(TopicPartition, long)`: specify the offset from which to read on a
+      given partition
+    - `seekToBeginning(Collection<TopicPartition>)`: seek from the beginning of a group of topics and partitions
+    - `seekToEnd(Collection<TopicPartition>)`: its opposite
+- Flow control allows pausing/resuming subscription to some topics or partitions
+    - `pause(TopicPartition)`
+    - `resume(TopicPartition)`
+    - mostly useful when a single consumer has to read multiple topics and partitions
+- Rebalance listeners: get notified when rebalances occur in the cluster, to adjust
+  in consumer code how to handle the offsets.