Skip to content

Commit 8829ac9

Browse files
committed
Addressing PR review
Signed-off-by: Soby Chacko <[email protected]>
1 parent d0f6965 commit 8829ac9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

spring-kafka/src/main/java/org/springframework/kafka/config/ShareKafkaListenerContainerFactory.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,9 @@ private void configureEndpoint(AbstractKafkaListenerEndpoint<K, V> endpoint) {
124124
*/
125125
protected void initializeContainer(ShareKafkaMessageListenerContainer<K, V> instance, KafkaListenerEndpoint endpoint) {
126126
ContainerProperties properties = instance.getContainerProperties();
127+
Boolean effectiveAutoStartup = endpoint.getAutoStartup() != null ? endpoint.getAutoStartup() : this.autoStartup;
127128
JavaUtils.INSTANCE
128-
.acceptIfNotNull(endpoint.getAutoStartup(), instance::setAutoStartup)
129-
.acceptIfNotNull(this.autoStartup, autoStartup -> {
130-
if (endpoint.getAutoStartup() == null) {
131-
instance.setAutoStartup(autoStartup);
132-
}
133-
})
129+
.acceptIfNotNull(effectiveAutoStartup, instance::setAutoStartup)
134130
.acceptIfNotNull(this.phase, instance::setPhase)
135131
.acceptIfNotNull(this.applicationContext, instance::setApplicationContext)
136132
.acceptIfNotNull(this.applicationEventPublisher, instance::setApplicationEventPublisher)

0 commit comments

Comments
 (0)