use of org.springframework.rabbit.stream.config.StreamRabbitListenerContainerFactory in project spring-boot by spring-projects.
the class RabbitStreamConfiguration method streamRabbitListenerContainerFactory.
@Bean(name = "rabbitListenerContainerFactory")
@ConditionalOnMissingBean(name = "rabbitListenerContainerFactory")
StreamRabbitListenerContainerFactory streamRabbitListenerContainerFactory(Environment rabbitStreamEnvironment, RabbitProperties properties, ObjectProvider<ConsumerCustomizer> consumerCustomizer, ObjectProvider<ContainerCustomizer<StreamListenerContainer>> containerCustomizer) {
StreamRabbitListenerContainerFactory factory = new StreamRabbitListenerContainerFactory(rabbitStreamEnvironment);
factory.setNativeListener(properties.getListener().getStream().isNativeListener());
consumerCustomizer.ifUnique(factory::setConsumerCustomizer);
containerCustomizer.ifUnique(factory::setContainerCustomizer);
return factory;
}
Aggregations