インターフェース 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
メソッドの詳細
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()orcommitAsync()is explicitly called- The consumer is closed
- 例外:
IllegalStateExceptionSE- if the record has already been acknowledged- 導入:
- 4.0
- The next
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()orcommitAsync()is explicitly called- The consumer is closed
- 例外:
IllegalStateExceptionSE- if the record has already been acknowledged
- The next
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()orcommitAsync()is explicitly called- The consumer is closed
- 例外:
IllegalStateExceptionSE- if the record has already been acknowledged
- The next