- This is a simple example of how to use Kafka with Spring Boot.
Using Docker
docker run ankush003/springbootxkafka
Using Maven
mvn spring-boot:run
- Jackson is a high-performance JSON processor for Java. It is a library for converting Java objects to and from JSON.
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.
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
is a generic interface that represents the result of an asynchronous computation.ListenableFuture
is a part of theorg.springframework.util.concurrent
package.