4

Using Kafka as a messaging system in a microservice architecture, I want to know which one is preferred, Spring Kafka, or Spring Integration Kafka and why? Also, on what factors we decide which one to choose?

Abhi Jain
  • 43
  • 1
  • 5

1 Answers1

6

Spring Integration - Extends the Spring programming model to support the well-known Enterprise Integration Patterns.

Spring Integration Kafka - is an extension module to the Spring Integration Project.

Spring Integration Kafka is now based on the Spring for Apache Kafka project.

The Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Kafka-based messaging solutions.

According to your requirements, if you are developing an application without using Spring Integration, then you need to use the Spring for Apache Kafka (spring-kafka) project or Spring Cloud Stream (Kafka).

Spring-Cloud-Stream - is a framework built upon Spring Boot for building message-driven microservices.

Spring-Kafka vs. Spring-Cloud-Stream (Kafka)

V. Mokrecov
  • 1,014
  • 1
  • 11
  • 20
  • Okay, but I am still confused as to which one to pick, spring kafka or spring integration kafka. Are there any specific advantages that spring integration has over spring kafka? – Abhi Jain Apr 13 '20 at 10:45
  • Spring Integration Kafka has the advantage of providing: Outbound Channel Adapter and Message-Driven Channel Adapter to use them in Spring Integration project. – V. Mokrecov Apr 13 '20 at 11:01
  • With Spring Integration for Apache Kafka version 3.3, you have channels backed by Kafka topics. https://docs.spring.io/spring-kafka/docs/2.5.3.RELEASE/reference/html/#si-channels – Kamal Maheshwari Jul 15 '20 at 19:12