Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commitBatch, commitBatchOption methods missing #1010

Closed
Matzz opened this issue Jul 11, 2022 · 1 comment
Closed

commitBatch, commitBatchOption methods missing #1010

Matzz opened this issue Jul 11, 2022 · 1 comment

Comments

@Matzz
Copy link

Matzz commented Jul 11, 2022

Hi,
Consumer documentation mention commitBatch, commitBatchOption. However, they do not exist in the code: https://github.com/fd4s/fs2-kafka/search?q=commitBatchOption

I wanted to use commitBatch which suppose use underlying chunks. My stream is already chunked because I try to commit offsets already grouped for producer:

val run = {
    val producerSettings: fs2.kafka.ProducerSettings[cats.effect.IO, String, String] = ???
    val consumerSettings: fs2.kafka.ConsumerSettings[cats.effect.IO, String, String] = ???
    KafkaProducer.stream(producerSettings)
      .flatMap { producer =>
        KafkaConsumer.stream(consumerSettings)
          .subscribeTo("topic")
          .records
          .map { committable =>
            val key = committable.record.key
            val value = committable.record.value
            val record = ProducerRecord("topic", key, value)
            ProducerRecords.one(record, committable.offset)
          }
          .evalMap(producer.produce)
          .groupWithin(500, 15.seconds)
          .evalMap(_.sequence)
          .evalMap { chunk =>
            val offsetsChunk: fs2.Chunk[CommittableOffset[effect.IO]] = chunk.map(_.passthrough)
            offsetsChunk
          }.through(
            ??? // What to put here.
          )
      }
      .compile.drain
  }

In general I don't see real example in docs for using passthrough of producer to commit consumed offsets.

@ASRagab
Copy link
Contributor

ASRagab commented Aug 27, 2022

#1022

Those methods were removed in an earlier version, the PR above updated the documentation to reflect that, this ticket can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants