# Kafka - Commit offset only after batch has been processed

**URL:** https://discuss.elastic.co/t/kafka-commit-offset-only-after-batch-has-been-processed/120445
**Category:** Logstash
**Created:** [February 19, 2018, 12:14pm UTC](https://discuss.elastic.co/t/kafka-commit-offset-only-after-batch-has-been-processed/120445 "2018-02-19T12:14:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shaharmor](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@shaharmor](https://discuss.elastic.co/u/shaharmor)
#### Post date: [February 19, 2018, 12:14pm UTC](https://discuss.elastic.co/t/kafka-commit-offset-only-after-batch-has-been-processed/120445/1 "2018-02-19T12:14:46Z")

</div>

Hey,

I understand after reading the code of the logstash-input-kafka plugin, that the offset it being committed after the batch has been transferred to the logstash internal queue, but not actually sent to the output (In my case Elasticsearch output).

Is there a wait to force logstash to wait for the batch to be fully committed to Elasticsearch before committing the offset to Kafka?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [February 19, 2018, 12:20pm UTC](https://discuss.elastic.co/t/kafka-commit-offset-only-after-batch-has-been-processed/120445/2 "2018-02-19T12:20:57Z")

</div>

This is currently not possible, but there is an [open issue](https://github.com/elastic/logstash/issues/8514) covering discussions around this type of functionality.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 19, 2018, 12:21pm UTC](https://discuss.elastic.co/t/kafka-commit-offset-only-after-batch-has-been-processed/120445/3 "2018-03-19T12:21:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
