# O Kafka, Where Art Thou?

DevFeed: [O Kafka, Where Art Thou?](<https://devfeed.tech/articles/o-kafka-where-art-thou-18844.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/kafka-where-art-thou/>)

Published: 2021-11-29T17:55:00Z

Content type: opinion

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Kafka](<https://devfeed.tech/topics/kafka.md>), [Java](<https://devfeed.tech/topics/java.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [Network](<https://devfeed.tech/topics/network.md>)

Tags: [connectivity](<https://devfeed.tech/tags/connectivity.md>), [issue](<https://devfeed.tech/tags/issue.md>), [java](<https://devfeed.tech/tags/java.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [logs](<https://devfeed.tech/tags/logs.md>), [network](<https://devfeed.tech/tags/network.md>)

## AI overview

This article examines how applications should handle Kafka producer failures, such as network connectivity problems or unavailable brokers. It explains that the appropriate strategy depends on the use case and whether inconsistencies between application state, caller state, and Kafka state are acceptable.

## Source excerpt

The other day, I came across an interesting thread in the Java sub-reddit, with someone asking: "Has anyone attempted to write logs directly to Kafka?". This triggered a number of thoughts and questions for myself, in particular how one should deal in an application when an attempt to send messages to Kafka fails, for instance due to some network connectivity issue? What do you do when you cannot reach the Kafka broker?