インターフェース ShareAcknowledgment


public interface ShareAcknowledgment
共有グループを使用するときにレコードの配信を確認するためのハンドル。

共有グループを使用すると、複数のコンシューマーが同じパーティションのレコードを処理できる協調消費が可能になります。処理結果を示すには、各レコードを明示的に確認応答する必要があります。

確認の種類:

  • ACCEPT - レコードは正常に処理されました
  • RELEASE - 一時的な障害、再試行可能にする
  • REJECT - Permanent failure, do not retry

This interface is only applicable when using explicit acknowledgment mode (share.acknowledgement.mode=explicit). In implicit mode, records are automatically acknowledged as ACCEPT.

メモ: Acknowledgment is separate from commit operations. After acknowledging records, use commitSync() or commitAsync() to persist the acknowledgments to the broker.

導入:
4.0
作成者:
Soby Chacko
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    void
    Acknowledge the record as successfully processed.
    void
    Reject the record due to a permanent failure.
    void
    Release the record for redelivery due to a transient failure.
  • メソッドの詳細

    • acknowledge

      void acknowledge()
      Acknowledge the record as successfully processed.

      The record will be marked as completed and will not be redelivered. The acknowledgment will be committed when:

      • The next poll() is called (batched with fetch)
      • commitSync() or commitAsync() is explicitly called
      • The consumer is closed
      例外:
      IllegalStateExceptionSE - if the record has already been acknowledged
      導入:
      4.0
    • release

      void release()
      Release the record for redelivery due to a transient failure.

      The record will be made available for another delivery attempt. The acknowledgment will be committed when:

      • The next poll() is called (batched with fetch)
      • commitSync() or commitAsync() is explicitly called
      • The consumer is closed
      例外:
      IllegalStateExceptionSE - if the record has already been acknowledged
    • reject

      void reject()
      Reject the record due to a permanent failure.

      The record will not be delivered again and will be archived. The acknowledgment will be committed when:

      • The next poll() is called (batched with fetch)
      • commitSync() or commitAsync() is explicitly called
      • The consumer is closed
      例外:
      IllegalStateExceptionSE - if the record has already been acknowledged