Add a configuration property for KLC's idleBetweenPolls

See gh-23048
pull/23084/head
hoaphan 4 years ago committed by Andy Wilkinson
parent 56ded38f5d
commit 03a8937d5c

@ -187,6 +187,7 @@ public class ConcurrentKafkaListenerContainerFactoryConfigurer {
map.from(properties::getIdleEventInterval).as(Duration::toMillis).to(container::setIdleEventInterval); map.from(properties::getIdleEventInterval).as(Duration::toMillis).to(container::setIdleEventInterval);
map.from(properties::getMonitorInterval).as(Duration::getSeconds).as(Number::intValue) map.from(properties::getMonitorInterval).as(Duration::getSeconds).as(Number::intValue)
.to(container::setMonitorInterval); .to(container::setMonitorInterval);
map.from(properties.getIdleBetweenPolls()).as(Duration::toMillis).to(container::setIdleBetweenPolls);
map.from(properties::getLogContainerConfig).to(container::setLogContainerConfig); map.from(properties::getLogContainerConfig).to(container::setLogContainerConfig);
map.from(properties::isMissingTopicsFatal).to(container::setMissingTopicsFatal); map.from(properties::isMissingTopicsFatal).to(container::setMissingTopicsFatal);
map.from(this.transactionManager).to(container::setTransactionManager); map.from(this.transactionManager).to(container::setTransactionManager);

@ -890,6 +890,12 @@ public class KafkaProperties {
*/ */
private Duration idleEventInterval; private Duration idleEventInterval;
/**
* The sleep interval in milliseconds between
* {@link org.apache.kafka.clients.consumer.Consumer#poll(Duration)} calls.
*/
private Duration idleBetweenPolls;
/** /**
* Time between checks for non-responsive consumers. If a duration suffix is not * Time between checks for non-responsive consumers. If a duration suffix is not
* specified, seconds will be used. * specified, seconds will be used.
@ -980,6 +986,14 @@ public class KafkaProperties {
this.idleEventInterval = idleEventInterval; this.idleEventInterval = idleEventInterval;
} }
public Duration getIdleBetweenPolls() {
return idleBetweenPolls;
}
public void setIdleBetweenPolls(Duration idleBetweenPolls) {
this.idleBetweenPolls = idleBetweenPolls;
}
public Duration getMonitorInterval() { public Duration getMonitorInterval() {
return this.monitorInterval; return this.monitorInterval;
} }
@ -1003,7 +1017,6 @@ public class KafkaProperties {
public void setMissingTopicsFatal(boolean missingTopicsFatal) { public void setMissingTopicsFatal(boolean missingTopicsFatal) {
this.missingTopicsFatal = missingTopicsFatal; this.missingTopicsFatal = missingTopicsFatal;
} }
} }
public static class Ssl { public static class Ssl {

Loading…
Cancel
Save