Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 1.7 KB

README.md

File metadata and controls

43 lines (32 loc) · 1.7 KB

Spring Boot X Kafka

  • This is a simple example of how to use Kafka with Spring Boot.

Architecture

image

Endpoints

image

image

Running

Using Docker

docker run ankush003/springbootxkafka

Using Maven

mvn spring-boot:run

Notes on Technology Used

Jackson

  • Jackson is a high-performance JSON processor for Java. It is a library for converting Java objects to and from JSON.

Kafka

  • KafkaTemplate is a high-level abstraction for sending messages to Kafka topics.
  • KafkaTemplate<Key, Value> is a generic class, where 'Key' is the type of the key and 'Value' is the type of the value.

Application Runners

  • ApplicationRunner is a functional interface that can be used to run the code after the Spring Boot application has started.
  • CommandLineRunner is a functional interface that can be used to run the code after the Spring Boot application has started.
  • @Order annotation can be used to specify the order of execution of the Application Runners.

ListenableFuture

  • ListenableFuture is a generic interface that represents the result of an asynchronous computation.
  • ListenableFuture is a part of the org.springframework.util.concurrent package.

References