|
|
|
@ -51,6 +51,7 @@ import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
|
|
|
|
|
import org.springframework.kafka.config.KafkaListenerContainerFactory;
|
|
|
|
|
import org.springframework.kafka.config.KafkaStreamsConfiguration;
|
|
|
|
|
import org.springframework.kafka.config.StreamsBuilderFactoryBean;
|
|
|
|
|
import org.springframework.kafka.core.ConsumerFactory;
|
|
|
|
|
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
|
|
|
|
|
import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
|
|
|
|
import org.springframework.kafka.core.KafkaAdmin;
|
|
|
|
@ -575,6 +576,16 @@ class KafkaAutoConfigurationTests {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void testConcurrentKafkaListenerContainerFactoryWithCustomConsumerFactory() {
|
|
|
|
|
this.contextRunner.withUserConfiguration(ConsumerFactoryConfiguration.class).run((context) -> {
|
|
|
|
|
ConcurrentKafkaListenerContainerFactory<?, ?> kafkaListenerContainerFactory = context
|
|
|
|
|
.getBean(ConcurrentKafkaListenerContainerFactory.class);
|
|
|
|
|
assertThat(kafkaListenerContainerFactory.getConsumerFactory())
|
|
|
|
|
.isNotSameAs(context.getBean(ConsumerFactoryConfiguration.class).consumerFactory);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void specificSecurityProtocolOverridesCommonSecurityProtocol() {
|
|
|
|
|
this.contextRunner.withPropertyValues("spring.kafka.security.protocol=SSL",
|
|
|
|
@ -653,6 +664,18 @@ class KafkaAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
|
static class ConsumerFactoryConfiguration {
|
|
|
|
|
|
|
|
|
|
private final ConsumerFactory<String, Object> consumerFactory = mock(ConsumerFactory.class);
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
ConsumerFactory<String, Object> myConsumerFactory() {
|
|
|
|
|
return this.consumerFactory;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
|
static class RecordInterceptorConfiguration {
|
|
|
|
|
|
|
|
|
|