Skip to content

fs2-kafka v1.8.0

Compare
Choose a tag to compare
@bplommer bplommer released this 23 Aug 09:08
· 179 commits to series/1.x since this release
6c9c28e

This release focuses on improving usability, with new helper methods for working with Kafka producers and consumers. This release is for users stuck on cats-effect 2. For cats-effect 3 users, v2.2.0 will be coming shortly.

New KafkaProducer syntax (#632 @keirlawson)

We've added several new helper methods for KafkaProducer to simplify common use cases.

Producing one record and getting the resulting record metadata - before:

producer.produce(ProducerRecords.one(ProducerRecord(topic, key, value))).map(_.map(_.records.head.get._2))

After:

producer.produceOne_(topic, key, value)

New KafkaConsumer syntax (#662 #664 @bplommer )

We've also added new extension methods for KafkaConsumer in the Stream context (no new imports needed!), so the most common operations no longer require explicit use of flatMap and evalTap. The stream and partitionedStream methods on KafkaConsumer can now be invoked as records and partitionedRecords respectively, for greater clarity.

Allocating a consumer, subscribing it to a topic, and streaming records - before:

KafkaConsumer.stream(consumerSettings)
  .evalTap(_.subscribeTo("topic"))
  .flatMap(_.stream)

After:

KafkaConsumer.stream(consumerSettings)
  .subscribeTo("topic")
  .records

Vulcan testkit (#629 @keirlawson)

A new module, fs2-kafka-vulcan-testkit-munit, makes it easier to test the schema compatibility of Vulcan codecs against a live schema registry instance.

Other changes

Various dependency updates