monix/monix-kafka

Manual commitAsync completes before actual commit

オープン

#94 opened on 2019/08/01

 (3 件のコメント) (1 件のリアクション) (0 人の担当者)Scala (36 件のフォーク)auto 404
buggood first issue

Repository metrics

Stars
 (124 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

In KafkaCOnsumerObservableManualCommit.scala:56 there's incorrect implementation of async commit

override def commitBatchAsync(batch: Map[TopicPartition, Long], callback: OffsetCommitCallback): Task[Unit] =
  Task {
    blocking(consumer.synchronized(consumer.commitAsync(batch.map {
      case (k, v) => k -> new OffsetAndMetadata(v)
     }.asJava, callback)))
  }

Apache kafka commitAsync(offsets, callback) returns immediately and invokes callback when commit completes

this task completes when consumer.commitAsync returns, not when callback invoked and also ignores possible commit errors also passed through callback, it should probably be rewritten to Task.async

コントリビューターガイド