<p>Recently my kafka producer running as a cronjob on a kubernetes cluster has started doing the following when pushing new messages to the queue:</p>
<pre><code>{&quot;@version&quot;:1,&quot;source_host&quot;:&quot;&lt;job pod name&gt;&quot;,&quot;message&quot;:&quot;[Producer clientId=producer-1] Resetting the last seen epoch of partition &lt;topic name&gt; to 4 since the associated topicId changed from null to JkTOJi-OSzavDEomRvAIOQ&quot;,&quot;thread_name&quot;:&quot;kafka-producer-network-thread | producer-1&quot;,&quot;@timestamp&quot;:&quot;2022-02-11T08:45:40.212+0000&quot;,&quot;level&quot;:&quot;INFO&quot;,&quot;logger_name&quot;:&quot;org.apache.kafka.clients.Metadata&quot;}
</code></pre>
<p>This results in the producer running into a timeout:</p>
<pre><code>&quot;exception&quot;:{&quot;exception_class&quot;:&quot;java.util.concurrent.ExecutionException&quot;,&quot;exception_message&quot;:&quot;org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for &lt;topic name&gt;:120000 ms has passed since batch creation&quot;, stacktrace....}
</code></pre>
<p>The logs of the kafka consumer pod and kafka cluster pods don't show any out-of-the-ordinary changes.</p>
<p>Has anyone seen this behavior before and if yes, how do I prevent it?</p>

<p>Reason:</p>
<blockquote>
<p>the Java API mode generator cannot connect with Kafka</p>
</blockquote>
<p>Solution:</p>
<blockquote>
<p>On each server Add a sentence to the properties file</p>
</blockquote>
<pre class="lang-sh prettyprint-override"><code>host.name = server IP;
</code></pre>
