@FunctionalInterface public interface ConfigFetchErrorHandler
RetryableResult.Success
to indicate operation is success even
though an error was thrown. Returned RetryableResult.Success
can either
contain an empty result or a default result depending on error condition.
2. Returning RetryableResult.Incomplete
to retry the operation.
3. Returning RetryableResult.Failure
to mark operation as failure and stop
any retries. In this case `null` is returned as result of operation.
4. By throwing an exception, in which case the exception will be propagated to
the caller. If the exception is a subclass of `RuntimeException` then it will
be rethrown as such, otherwise it will be wrapped in a RuntimeException and then
rethrown.Modifier and Type | Method and Description |
---|---|
RetryableResult<Map<org.apache.kafka.common.config.ConfigResource,org.apache.kafka.clients.admin.Config>> |
handleError(org.apache.kafka.common.config.ConfigResource resource,
Exception ex)
This method will be invoked when fetching a config for the
resource parameter
results in an error. |
RetryableResult<Map<org.apache.kafka.common.config.ConfigResource,org.apache.kafka.clients.admin.Config>> handleError(org.apache.kafka.common.config.ConfigResource resource, Exception ex)
resource
parameter
results in an error. The error is passed in as argumentresource
- A config resource object for which describeConfig was called. ConfigResource
is a POJO with two fields:
1. Type: like TOPIC, BROKER etc
2. Name: like '__consumer-offset`, `kafka-0` etc.ex
- Exception that was thrown. This is guaranteed to be not null.RetryableResult
class. Depending on the
subclass returned the OperationRetryer
will
take different actions.