Skip to content

gAmUssA/ktor-kafka

Repository files navigation

Ktor Kafka Feature

Usage

  • add dependency and jitpack repo

    build.gradle
    repositories {
      maven { url 'https://jitpack.io' }
    }
    
    dependencies {
      implementation 'com.github.gAmUssA:ktor-kafka:main-SNAPSHOT'
    }
    build.gradle.kts
    repositories {
        maven {
            url = uri("https://jitpack.io")
        }
    }
    
    dependencies{
        implementation("com.github.gAmUssA:ktor-kafka:main-SNAPSHOT")
    }
  • in Application.module

    Application.kt
    import io.confluent.developer.ktor.Kafka
    import io.confluent.developer.ktor.newTopic
    
    fun Application.module(){
    
        //install Kafka feature
        install(Kafka) {
            configurationPath = "src/main/resources/kafka.conf"
            topics = listOf(
                newTopic("myTopic") {
                    partitions = 3
                    replicas = 1
                }
            )
        }
    }

About

Kafka feature for Ktor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published