Error Handling
Controls the replicator's behavior when encountering anomalies or processing errors.
The errorHandling
configuration block provides fine-grained control over the replicator's fault-tolerance behavior. It allows you to define how K2K should respond to specific, non-terminal error conditions encountered during its internal operations.
fail
(Default): Implements a fail-fast strategy by stopping the K2K task immediately upon error detection and reporting a failure. This approach prevents further data inconsistency and requires operator intervention or an external orchestration system to restart the task. It is considered the safest and is generally recommended for most scenarios.ignore
: Logs the error and allows the K2K task to continue operation. While this may improve availability for transient issues, it should be used with caution. Ignoring persistent errors can lead to an unpredictable application state or obscure serious underlying problems.
onCommitSyncTimeout
Defines the behavior when a timeout occurs while K2K is trying to determine the latest committed offset from its internal coordination topic.
fail
, ignore
fail
onControlMessageDeserializationError
Defines the behavior when a message on one of K2K's internal topics (e.g., __k2k-assignment
) cannot be deserialized. This can indicate data corruption or a version mismatch between K2K instances.
fail
, ignore
fail
The following example configures the replicator to ignore commit sync timeouts while retaining the default fail-fast behavior for deserialization errors.
# ---------------------------------------------------
# K2K Error Handling Configuration
# ---------------------------------------------------
errorHandling:
# This configuration sets the replicator to continue operating even if it
# temporarily fails to determine its latest committed offset.
# WARNING: Use 'ignore' with caution as it may mask underlying issues.
onCommitSyncTimeout: ignore
# The replicator will use the default behavior ('fail') for this error type,
# as it is not specified.
# onControlMessageDeserializationError: fail
Last updated
Was this helpful?