Skip to content

fs2-kafka v3.0.0

Compare
Choose a tag to compare
@bplommer bplommer released this 11 Apr 13:02
· 50 commits to series/2.x since this release
2953ada

This is the first stable fs2-kafka release to be based on the 3.x series of the Apache Kafka client library. It is available for Scala 2.12, 2.13, and 3.2; all users are encouraged to upgrade. There are some backwards-incompatible API changes, set out below; for further details, see release notes for 3.0.0-RC1 and previous milestone versions.

Development of the 2.x series will now start to wind down, and the 1.x series will be discontinued. New pull requests that make substantial changes should target the 3.x branch.

Apologies to those whose outstanding pull requests weren't merged in time for this release - it was already very overdue. The intention is to start a 4.x branch in the near future to make further backwards-incompatible improvements.

Backwards-incompatible changes

Serializers and Deserializers

Some changes have been made to how fs2-kafka represents Serializers and Deserializers. The following references Serializers but the same changes have been made to Deserializers.

Typed KeySerializer and ValueSerializer

In some cases, such as when using a schema registry with the fs2-kafka-vulcan module, a given serializer will only be valid either for keys or for values, but not both. This is now represented by the KeySerializer type, representing the ability to serialize a key, and the ValueSerializer type, representing the ability to serialize a value. These are supertypes of the plain Serializer type, which can serialize either a key or a value.

Implementation note: KeySerializer, ValueSerializer and Serializer are aliased subtypes of a new GenericSerializer class, which is contravariantly parameterized with a marker trait KeyOrValue with subtypes Key and Value. User code usually won't need to be concerned with these details.

Replacement of RecordSerializer (and RecordDeserializer) with Resource

RecordSerializer served two purposes: to distinguish between key and value serializers when summoning them implicitly, and to wrap effectful instantiation of serializers. The former purpose is now served by the KeySerializer and ValueSerializer types; the latter, by cats-effect's Resource type. Usages of RecordSerializer[F, A] are thus now replaced by Resource[F, KeySerializer[F, A]] or Resource[F, ValueSerializer[F, A]].

Change to Vulcan module's API

The AvroSerializer class no longer has a using method that returns RecordSerializer; instead it has two methods, forKey and forValue, that respectively return KeySerializer and ValueSerializer inside Resource. (Equivalent changes have been made to AvroDeserializer.)

Simplified representation of producer records (#901)

The ProducerRecords, TransactionalProducerRecords and ProducerResult classes have been replaced with type aliases for different kinds of fs2.Chunk, which they previously wrapped. This was enabled by removal of "passthrough" functionality, which can instead be implemented in user code if needed.

What's Changed since v3.0.0-RC1

Full Changelog since v2.6.0: v2.6.0...v3.0.0