FS2 Kafka

FS2 Kafka

  • API Docs
  • Documentation
  • GitHub

›Documentation

Documentation

  • Overview
  • Quick Example
  • Consumers
  • Producers
  • Transactions
  • Admin
  • Modules
  • Technical Details

Overview

Functional backpressured streams for consuming and producing Kafka records. Exposes a small interface, while taking care of common functionality: batch consuming and producing records, batched offset commits, offset commit recovery, and topic administration, while also simplifying client configuration.

Documentation is kept up-to-date, currently documenting v3.8.0 on Scala 2.13.

Getting Started

To get started with sbt, simply add the following line to your build.sbt file.

libraryDependencies += "com.github.fd4s" %% "fs2-kafka" % "3.8.0"

Published for Scala 2.12, 2.13 and 3.3. For changes, refer to the release notes.

For Scala 2.12, enable partial unification by adding the following line to build.sbt.

scalacOptions += "-Ypartial-unification"

Modules

For Avro support using Vulcan, add the following lines to your build.sbt file.

resolvers += "confluent" at "https://packages.confluent.io/maven/"

libraryDependencies += "com.github.fd4s" %% "fs2-kafka-vulcan" % "3.8.0"

In order to test vulcan codecs against a schema registry using munit, add the following line to your build.sbt file.

libraryDependencies += "com.github.fd4s" %% "fs2-kafka-vulcan-testkit-munit" % "3.8.0"

Signatures

Stable release artifacts are signed with the E97C 64AB 4987 7F74 key.

Compatibility

Backwards binary-compatibility for the library is guaranteed between minor and patch versions.
Version 3.a.b is backwards binary-compatible with 3.c.d for any a > c or a = c and b > d.

Please note binary-compatibility is not guaranteed between milestone releases.

Snapshot Releases

To use the latest snapshot release, add the following lines to your build.sbt file.

resolvers += Resolver.sonatypeRepo("snapshots")

libraryDependencies += "com.github.fd4s" %% "fs2-kafka" % "3.8.0"

Dependencies

Refer to the table below for dependencies and version support across modules.

ModuleDependenciesScala
fs2-kafkaFS2 3.12.0, Apache Kafka Client 3.9.0Scala 2.12, 2.13 and 3.3
fs2-kafka-vulcanVulcan 1.12.0, Confluent Kafka Avro Serializer 7.9.0Scala 2.12, 2.13 and 3.3

Inspiration

Library is heavily inspired by ideas from Alpakka Kafka.

License

Licensed under the Apache License 2.0. Refer to the license file.

Quick Example →
  • Getting Started
    • Modules
    • Signatures
    • Compatibility
    • Snapshot Releases
  • Dependencies
  • Inspiration
  • License

Copyright © 2018-2025 OVO Energy Limited.
Icon by Franco Averta. CC BY 3.0.