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 v4.1.0 on Scala 2.13.
Getting Started
To get started with sbt, simply add the following line to your build.sbt file.
libraryDependencies += "org.typelevel" %% "fs2-kafka" % "4.1.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 += "org.typelevel" %% "fs2-kafka-vulcan" % "4.1.0"
In order to test vulcan codecs against a schema registry using
munit, add the following line to your build.sbt file.
libraryDependencies += "org.typelevel" %% "fs2-kafka-vulcan-testkit-munit" % "4.1.0"
External Modules
Following is an incomplete list of third-party integrations.
Signatures
Stable release artifacts are signed with the 14CA 4AC4 FDB0 0D5F key.
Compatibility
Backwards binary-compatibility for the library is guaranteed between minor and patch versions.
Version 4.a.b is backwards binary-compatible with 4.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.sonatypeCentralSnapshots
libraryDependencies += "org.typelevel" %% "fs2-kafka" % "4.1.0"
Dependencies
Refer to the table below for dependencies and version support across modules.
| Module | Dependencies | Scala |
|---|---|---|
fs2-kafka | FS2 3.14.0, Apache Kafka Client 4.3.1 | Scala 2.12, 2.13 and 3.3 |
fs2-kafka-vulcan | Vulcan 1.14.0, Confluent Kafka Avro Serializer 8.3.1 | Scala 2.12, 2.13 and 3.3 |
Adopters
Following are some companies using FS2 Kafka in production.
Feel free to raise a pull request to add your company to the list.
Inspiration
Library is heavily inspired by ideas from Alpakka Kafka.
Participation
FS2 Kafka embraces pure, typeful, idiomatic functional programming in Scala, and wants to provide a safe and friendly environment for teaching, learning, and contributing as described in the Scala Code of Conduct.
License
Licensed under the Apache License 2.0. Refer to the license file.