# State of Kafka Producer

**URL:** <https://forum.confluent.io/t/state-of-kafka-producer/6280>\
**Category:** Kafka Streams\
**Created:** [13 October 2022 17:02 UTC](https://forum.confluent.io/t/state-of-kafka-producer/6280 "2022-10-13T17:02:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Turhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/turhan/32/2472_2.png) [@Turhan](https://forum.confluent.io/u/Turhan)\
**Post date:** [13 October 2022 17:02 UTC](https://forum.confluent.io/t/state-of-kafka-producer/6280/1 "2022-10-13T17:02:28Z")

</div>

I want to stop when Kafka throws and error and resume sending when it recovers from the error. For example if the cluster is down, I wont sent messages but I want to start automatically when connection is established. How can I get the state information of the producer?

---

<div class="post-metadata">

**Author:** ![OneCricketeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/onecricketeer/32/1551_2.png) [@OneCricketeer](https://forum.confluent.io/u/OneCricketeer)\
**Post date:** [19 October 2022 15:36 UTC](https://forum.confluent.io/t/state-of-kafka-producer/6280/2 "2022-10-19T15:36:25Z")

</div>

Have you tried accessing [`KafkaStreams.State`](https://kafka.apache.org/32/javadoc/org/apache/kafka/streams/KafkaStreams.State.html) ?
