Skip to content

Commit 0e07e55

Browse files
authored
Merge pull request #1022 from ASRagab/aragab/remove-references-commit-methods
Removing references to `commitBatch` and `commitBatchOption` in Documentation
2 parents c8f2053 + d6568cb commit 0e07e55

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ target/
77
.metals/
88
.vscode/
99
.bloop/
10+
.idea/
11+
.bsp/
1012
metals.sbt

docs/src/main/mdoc/consumers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Offsets commits are managed manually, which is important for ensuring at-least-o
266266

267267
Offset commits are usually done in batches for performance reasons. We normally don't need to commit every offset, but only the last processed offset. There is a trade-off in how much reprocessing we have to do when we restart versus the performance implication of committing more frequently. Depending on our situation, we'll then choose an appropriate frequency for offset commits.
268268

269-
We should keep the [`CommittableOffset`][committableoffset] in our `Stream` once we've finished processing the record. For at-least-once delivery, it's essential that offset commits preserve topic-partition ordering, so we have to make sure we keep offsets in the same order as we receive them. There are then several functions available for common batch committing scenarios, like `commitBatch`, `commitBatchOption`, and `commitBatchWithin`.
269+
We should keep the [`CommittableOffset`][committableoffset] in our `Stream` once we've finished processing the record. For at-least-once delivery, it's essential that offset commits preserve topic-partition ordering, so we have to make sure we keep offsets in the same order as we receive them. There is one convenience function for the most common batch committing scenario, `commitBatchWithin`.
270270

271271
```scala mdoc:silent
272272
object ConsumerCommitBatchExample extends IOApp.Simple {
@@ -289,7 +289,7 @@ object ConsumerCommitBatchExample extends IOApp.Simple {
289289
}
290290
```
291291

292-
The example above commits once every 500 offsets or 15 seconds, whichever happens first. Alternatively, `commitBatch` uses the underlying chunking of the `Stream`, committing once every `Chunk`, while the `commitBatchOption` function does the same except when offsets are wrapped in `Option`.
292+
The example above commits once every 500 offsets or 15 seconds, whichever happens first. The batch commit functions uses [`CommittableOffsetBatch`][committableoffsetbatch] and provided [functions][committableoffsetbatch$] for batching offsets.
293293

294294
The batch commit functions uses [`CommittableOffsetBatch`][committableoffsetbatch] and provided [functions][committableoffsetbatch$] for batching offsets. For more involved batch commit scenarios, we can use [`CommittableOffsetBatch`][committableoffsetbatch] to batch offsets, while having custom logic to determine batch frequency.
295295

0 commit comments

Comments
 (0)