-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide auto-configuration for Reactor Kafka #18751
Comments
Thanks for the suggestion. The whole auto-configuration, of which
I don't think it makes sense for Spring Boot to offer configuration for Kafka without using Spring for Apache Kafka. Our opinion is that it makes sense to use the latter when interacting with Kafka in a Spring application. If you have use cases where that's not true, please share them here and we can reconsider or pass them on to the Spring for Apache Kafka team for them to look at. |
@wilkinsona, all our applications are microservices that relies on Spring Boot + Spring Webflux. All those microservices fully leverages Reactive programming so it was pretty obvious for us to connect to Kafka embracing reactive libraries. That's why we are using reactor-kafka to communicate with Kafka. Even if Spring-kafka supports some async types, IMHO it's not fully embracing reactive programming like reactor-kafka does. We are very pleased by all the effort made so for by Spring teams to push Java reactive support forward, it seems logical that Spring Boot enables easy Kafka configuration through KafkaProperties class letting users choose the fully reactive implementation reactor-kafka or the classic spring-kafka. |
Thanks. So it sounds like what you're really looking for is auto-configuration support for Reactor Kafka. Can you share some details of how you're currently using Reactor Kafka and how you're using |
Actually that's pretty straightforward, we inject @Bean
fun sender(properties: KafkaProperties): KafkaSender<String, String> {
val options = SenderOptions.create<String, String>(properties.buildProducerProperties())
return KafkaSender.create<String, String>(options)
} Hence both The full reactor auto configuration support would be great. Nevertheless, being able to simply inject |
Thanks for the additional information.
This (alone) almost certainly won't happen. As I mentioned above, Boot's own |
So you intent to provide a reactor-kafka auto configuration mechanism ? |
We don't know yet, hence this issue still being labelled as waiting for triage. We can certainly consider it though. In the meantime, I would strongly encourage you to use your own configuration properties and |
Yes that's what I intent to do. Thanks ! |
Having discussed this with the Reactor team, we've decided not to add auto-configuration for Reactor Kafka at this time. If the situation changes, we can re-open this issue and reconsider. Thanks for the suggestion, @jntakpe. |
Understand the decision. Can you provide a quick tldr-style example here (or link thereto) that uses |
@matthewadams Unfortunately we don't have such an example to hand. The properties would really depend on your use case and the Reactor Kafka settings that you want to be able to configure using externalised properties. |
Spring Boot provides a great helper configuration KafkaProperties class for Kafka.
This class includes two
spring-kafka
module classes :Due to those imports, in order to leverage Spring Boot's Kafka auto configuration, it is required to import
spring-kafka
module which is largely increasing the application size (our projects are using Reactor Kafka).IMHO, the configuration that depends on
spring-kafka
should be moved tospring-kafka
module, allowing Spring Boot's projects to leverage automatic type safe Kafka configuration without importingspring-kafka
.The text was updated successfully, but these errors were encountered: