Search code examples
apache-kafkaspring-cloudspring-cloud-stream

Spring Cloud Stream - Kafka binder


What is the difference between these 2 binders? Their behaviors are more or less same - like producing, processing and consuming.

https://cloud.spring.io/spring-cloud-static/spring-cloud-stream-binder-kafka/3.0.0.RELEASE/reference/html/spring-cloud-stream-binder-kafka.html#_reference_guide

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream-binder-kafka-streams</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream-binder-kafka</artifactId>
    </dependency>

Solution

  • The first is specifically for Kafka Streams (KStream, KTable), the second uses the kafka Consumer and Producer clients directly (via spring-kafka and spring-integration-kafka).