1. Spring Boot
  2. Tutorial

Create Project

Create a new directory anywhere you’d like for this project:

mkdir kafka-spring-boot-getting-started && cd kafka-spring-boot-getting-started

Create the following Gradle build file for the project, named build.gradle:

buildscript {
  repositories {
    jcenter()
  }
}

plugins {
  id 'org.springframework.boot' version "3.2.3"
  id 'io.spring.dependency-management' version '1.1.4'
  id 'java'
}

repositories {
  jcenter()
}

apply plugin: 'idea'

group = 'examples'
version = '0.0.1'
sourceCompatibility = 17

repositories {
  jcenter()
}

dependencies {
  implementation 'org.springframework.boot:spring-boot-starter-web:3.2.3'
  implementation 'org.apache.kafka:kafka-clients'
  implementation 'org.springframework.kafka:spring-kafka'
}

bootRun {
  systemProperties "java.security.manager": "allow"
}
Previous
Prerequisites