Skip to content

Commit

Permalink
GH-222: Expose KCL gracefulShutdownTimeout
Browse files Browse the repository at this point in the history
Fixes: #222
Issue link: #222
  • Loading branch information
artembilan committed Sep 26, 2024
1 parent 0fbad29 commit 4efb48d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ The KCL idle between requests in polling mode.
+
Default: 1500L

gracefulShutdownTimeout::
The KCL graceful shutdown timeout in milliseconds.
+
Default: 0 - regular shutdown process

Starting with version `4.0.4` (basically since `spring-integration-aws-3.0.8`), the `KclMessageDrivenChannelAdapter` can be customized programmatically for the `ConfigsBuilder` parts.
For example, to set a custom value for the `LeaseManagementConfig.maxLeasesForWorker` property, the `ConsumerEndpointCustomizer<KclMessageDrivenChannelAdapter>` bean has to be provided:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ private MessageProducerSupport createKclConsumerEndpoint(ConsumerDestination des
adapter.setLeaseTableName(kinesisConsumerProperties.getLeaseTableName());
adapter.setPollingMaxRecords(kinesisConsumerProperties.getPollingMaxRecords());
adapter.setPollingIdleTime(kinesisConsumerProperties.getPollingIdleTime());
adapter.setGracefulShutdownTimeout(kinesisConsumerProperties.getGracefulShutdownTimeout());
if (properties.getExtension().isEmbedHeaders()) {
adapter.setEmbeddedHeadersMapper(this.embeddedHeadersMapper);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ public class KinesisConsumerProperties {
*/
private long pollingIdleTime = 1500L;

/**
* The KCL graceful shutdown timeout in milliseconds.
*/
private long gracefulShutdownTimeout;

private boolean embedHeaders;

/**
Expand Down Expand Up @@ -231,4 +236,12 @@ public void setPollingIdleTime(long pollingIdleTime) {
this.pollingIdleTime = pollingIdleTime;
}

public long getGracefulShutdownTimeout() {
return this.gracefulShutdownTimeout;
}

public void setGracefulShutdownTimeout(long gracefulShutdownTimeout) {
this.gracefulShutdownTimeout = gracefulShutdownTimeout;
}

}

0 comments on commit 4efb48d

Please sign in to comment.