- This is a simple example of how to use Kafka with Spring Boot.
Using Docker
docker run ankush003/springbootxkafkaUsing 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.
KafkaTemplateis 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.
ApplicationRunneris a functional interface that can be used to run the code after the Spring Boot application has started.CommandLineRunneris a functional interface that can be used to run the code after the Spring Boot application has started.@Orderannotation can be used to specify the order of execution of the Application Runners.
ListenableFutureis a generic interface that represents the result of an asynchronous computation.ListenableFutureis a part of theorg.springframework.util.concurrentpackage.


