Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve initial connection timeouts with Amazon MSK clusters #275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 @@ -49,6 +49,9 @@ public abstract class Channel {

private static final Logger LOG = LoggerFactory.getLogger(Channel.class);

// 30 seconds set as minimum for Amazon MSK to connect successfully
protected static final int INITIAL_CONNECTION_TIMEOUT_MS = 30000;

private final String controlTopic;
private final String groupId;
private final Producer<String, byte[]> producer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private CommitterImpl(

consumeAvailable(
// initial poll with longer duration so the consumer will initialize...
Duration.ofMillis(1000),
Duration.ofMillis(INITIAL_CONNECTION_TIMEOUT_MS),
envelope ->
receive(
envelope,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Coordinator(
this.commitState = new CommitState(config);

// initial poll with longer duration so the consumer will initialize...
consumeAvailable(Duration.ofMillis(1000), this::receive);
consumeAvailable(Duration.ofMillis(INITIAL_CONNECTION_TIMEOUT_MS), this::receive);
}

public void process() {
Expand Down