@Incubating @FunctionalInterface public interface OffsetCommitPolicy
| Modifier and Type | Interface and Description |
|---|---|
static class |
OffsetCommitPolicy.AlwaysCommitOffsetPolicy
An
OffsetCommitPolicy that will commit offsets as frequently as possible. |
static class |
OffsetCommitPolicy.PeriodicCommitOffsetPolicy
An
OffsetCommitPolicy that will commit offsets no more than the specified time period. |
| Modifier and Type | Method and Description |
|---|---|
static OffsetCommitPolicy |
always() |
default OffsetCommitPolicy |
and(OffsetCommitPolicy other)
Obtain a new
OffsetCommitPolicy that will commit offsets if both this policy AND the other requests it. |
default OffsetCommitPolicy |
or(OffsetCommitPolicy other)
Obtain a new
OffsetCommitPolicy that will commit offsets if this policy OR the other requests it. |
boolean |
performCommit(long numberOfMessagesSinceLastCommit,
Duration timeSinceLastCommit)
Determine if a commit of the offsets should be performed.
|
static OffsetCommitPolicy |
periodic(Properties config) |
static OffsetCommitPolicy always()
static OffsetCommitPolicy periodic(Properties config)
boolean performCommit(long numberOfMessagesSinceLastCommit,
Duration timeSinceLastCommit)
numberOfMessagesSinceLastCommit - the number of messages that have been received from the connector since last
the offsets were last committed; never negativetimeSinceLastCommit - the time that has elapsed since the offsets were last committed; never negativetrue if the offsets should be committed, or false otherwisedefault OffsetCommitPolicy or(OffsetCommitPolicy other)
OffsetCommitPolicy that will commit offsets if this policy OR the other requests it.other - the other commit policy; if null, then this policy instance is returned as isdefault OffsetCommitPolicy and(OffsetCommitPolicy other)
OffsetCommitPolicy that will commit offsets if both this policy AND the other requests it.other - the other commit policy; if null, then this policy instance is returned as isCopyright © 2021 JBoss by Red Hat. All rights reserved.