'Which kafka library to use in spring boot application [closed]
I am working on a spring boot application, Which dependent library to use just to consume and push data to database.
spring-kafka or spring-cloud-stream-binder-kafka
Solution 1:[1]
Depends what you need to do.
If you want to move data between topics in the same Kafka cluster, and want to use Kafka Streams Topologies, then you can use the Spring Cloud Stream binder.
That being said, spring-cloud-stream-binder-kafka doesn't have a producer (KafkaTemplate), that comes directly from spring-kafka, so if the goal is only to create a basic producer or topic-listener, then you only should need spring-kafka
Solution 2:[2]
Spring cloud stream is built on top of spring kafka. If you want to integrate with external messaging systems then you should go with spring-cloud-stream-binder-kafka. You can also refer this link.
But if you don't want such integrations and just need good performance then you should go with spring-kafka.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | OneCricketeer |
| Solution 2 | ANKIT PRASAD |
