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

KafkaPublisher Ack timeout can be set via properties and autoconfiguration #528

Merged
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 @@ -234,6 +234,12 @@ public static class Publisher {
*/
private String processingGroup = DEFAULT_PROCESSING_GROUP;

/**
* The publisher acknowledge timeout in milliseconds specifying how long to wait for a publisher to
* acknowledge a message has been sent. Defaults to {@code 1000} milliseconds.
*/
private long ackTimeout = 1000;

public boolean isEnabled() {
return enabled;
}
Expand All @@ -257,6 +263,14 @@ public String getProcessingGroup() {
public void setProcessingGroup(String processingGroup) {
this.processingGroup = processingGroup;
}

public long getAckTimeout() {
return ackTimeout;
}

public void setAckTimeout(long ackTimeout) {
this.ackTimeout = ackTimeout;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public TopicResolver topicResolver() {
.messageConverter(kafkaMessageConverter)
.messageMonitor(configuration.messageMonitor(KafkaPublisher.class, "kafkaPublisher"))
.topicResolver(topicResolver)
.publisherAckTimeout(properties.getPublisher().getAckTimeout())
.build();
}

Expand Down
Loading