Skip to content

Commit

Permalink
KafkaPublisher Ack timeout can be set via properties and autoconfigur…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
aupodogov committed Sep 9, 2024
1 parent f2e9c2d commit a4e2be0
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 a4e2be0

Please sign in to comment.