Skip to content
Scala wrapper for kafka consumer and producer
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
modules use less quantiles Jul 1, 2019
project update dependencies Jul 1, 2019
skafka/src fix partitioner.class: Class org.apache.kafka.clients.producer.intern… Jul 2, 2019
tests/src/test
.gitignore setup project Feb 1, 2018
.travis.yml
LICENSE setup project Feb 1, 2018
README.md
build.sbt
version.sbt

README.md

Skafka Build Status Coverage Status Codacy Badge version License: MIT

Scala wrapper for kafka-clients v2.2.1

Key features

  1. It provides null-less Scala apis for Producer & Consumer

  2. Makes it easy to use your effect monad with help of cats-effect

  3. Blocking calls are being executed on provided ExecutionContext.

  4. Simple case class based configuration

  5. Support of typesafe config

Producer usage example

val producer = Producer.of[IO](config, ecBlocking)
val metadata: IO[RecordMetadata] = producer.use { producer =>
  val record = ProducerRecord(topic = "topic", key = "key", value = "value") 
  producer.send(record).flatten 
}

Consumer usage example

val consumer = Consumer.of[IO, String, String](config, ecBlocking)
val records: IO[ConsumerRecords[String, String]] = consumer.use { consumer => 
  for {
    _       <- consumer.subscribe(Nel("topic"), None)
    records <- consumer.poll(100.millis)
  } yield records 
}

Setup

resolvers += Resolver.bintrayRepo("evolutiongaming", "maven")

libraryDependencies += "com.evolutiongaming" %% "skafka" % "4.0.4"

libraryDependencies += "com.evolutiongaming" %% "skafka-prometheus" % "4.0.4"

libraryDependencies += "com.evolutiongaming" %% "skafka-play-json" % "4.0.4"
You can’t perform that action at this time.