diff --git a/binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/StreamsBuilderFactoryManager.java b/binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/StreamsBuilderFactoryManager.java index a93f8dfdf..3682621d0 100644 --- a/binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/StreamsBuilderFactoryManager.java +++ b/binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/java/org/springframework/cloud/stream/binder/kafka/streams/StreamsBuilderFactoryManager.java @@ -102,10 +102,10 @@ public synchronized void start() { this.kafkaStreamsBindingInformationCatalogue.getConsumerPropertiesPerSbfb(); final List consumerProperties = bindingServicePropertiesPerSbfb.get(streamsBuilderFactoryBean); final boolean autoStartupDisabledOnAtLeastOneConsumerBinding = consumerProperties.stream().anyMatch(consumerProperties1 -> !consumerProperties1.isAutoStartup()); + if (streamsBuilderFactoryBean instanceof SmartInitializingSingleton) { + ((SmartInitializingSingleton) streamsBuilderFactoryBean).afterSingletonsInstantiated(); + } if (!autoStartupDisabledOnAtLeastOneConsumerBinding) { - if (streamsBuilderFactoryBean instanceof SmartInitializingSingleton) { - ((SmartInitializingSingleton) streamsBuilderFactoryBean).afterSingletonsInstantiated(); - } streamsBuilderFactoryBean.start(); this.kafkaStreamsRegistry.registerKafkaStreams(streamsBuilderFactoryBean); }