Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Send events to error handlers when broker is unavailable #144

Merged
merged 2 commits into from
Nov 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
type = {DataType.STRING},
defaultValue = "null"),
@Parameter(name = "is.synchronous",
description = "The Kafka sync will publish the events to the server synchronously when the" +
description = "The Kafka sink will publish the events to the server synchronously when the" +
"value is set to `true`, and asynchronously if otherwise",
optional = true,
type = {DataType.BOOL},
Expand Down Expand Up @@ -298,6 +298,10 @@ public void publish(Object payload, DynamicOptions dynamicOptions, KafkaSinkStat
metrics.getErrorCountPerStream(
streamId, topic, Integer.parseInt(partitionNo), e.getClass().getSimpleName()).inc();
}
if (e.getMessage().contains("apache.kafka.common.errors.TimeoutException")) {
throw new ConnectionUnavailableException("TimeoutException occurred when trying to send " +
"message. Broker may not be unavailable.", e);
}
}
} else {
if (null == partitionNo) {
Expand Down