Maximizing CDC Replication Engine for Kafka robustness
You can configure the properties file of the CDC Kafka producer to leverage Kafka's native handling for leader rebalancing, broker failure, and other errors from the Kafka server.
Procedure
What to do next
For a full discussion of these parameters and their implications, see the Apache Kafka documentation.
To tune the values for your environment, adjust the Kafka producer properties retry.backoff.ms and retries according to the following formula:
retry.backoff.ms * retries > the anticipated maximum time for leader change metadata to propagate in the cluster
For example, you might want to configure enable.idempotence=true, retry.backoff.ms=300, and retries=150.
"Allowing retries without setting max.in.flight.requests.per.connection to 1 will potentially change the ordering of records because if two batches are sent to a single partition, and the first fails and is retried but the second succeeds, then the records in the second batch may appear first."
If max.in.flight.requests.per.connection is set to 1, when a Kafka producer returns an error to the CDC Replication Engine for Kafka, replication ends for that subscription. Duplicate records might be written when the next CDC mirroring session starts. Depending on business logic, you might wish to increase max.in.flight.requests.per.connection. If you do so, note that transparent retries for the producer with a single batch in flight means you might see a repeated batch within a single replication session.