Skip to content

Commit

Permalink
Merge pull request #528 from aupodogov/set-publisher-ack-timeout-in-a…
Browse files Browse the repository at this point in the history
…uto-configuration

KafkaPublisher Ack timeout can be set via properties and autoconfiguration
  • Loading branch information
smcvb authored Sep 16, 2024
2 parents 4611b46 + a4e2be0 commit f18dc4c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
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

0 comments on commit f18dc4c

Please sign in to comment.