# Kafka publish to broker error

**URL:** <https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929>\
**Category:** Module Development\
**Created:** [November 21, 2024, 12:46pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929 "2024-11-21T12:46:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rez\_S](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rez\_S](https://forum.inductiveautomation.com/u/Rez_S)\
**Post date:** [November 21, 2024, 12:46pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/1 "2024-11-21T12:46:33Z")

</div>

Hi.

I developed an ignition module that connects to the Kafka Broker([Confluent.io](http://Confluent.io)) and publishes messages to the topics. but get this errors:

[Producer clientId=producer-1] Connection to node -1 (bootstrap\_server:9092) terminated during authentication. This may happen due to any of the following reasons: (1) Authentication failed due to invalid credentials with brokers older than 1.0.0, (2) Firewall blocking Kafka TLS traffic (eg it may only allow HTTPS traffic), (3) Transient network issue.

do I need to use truststore and keystore?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 21, 2024, 4:15pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/2 "2024-11-21T16:15:57Z")

</div>

This seems entirely like a problem between your code and your Kafka server.

We have a first party Kafka client module coming in 8.3, for what it's worth.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 21, 2024, 5:10pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/3 "2024-11-21T17:10:54Z")

</div>

_Pssst!_ That's a terrible topic title--making our eyes glaze will not attract attention from helpful people.

---

<div class="post-metadata">

**Author:** ![Rez\_S](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rez\_S](https://forum.inductiveautomation.com/u/Rez_S)\
**Post date:** [November 21, 2024, 7:35pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/4 "2024-11-21T19:35:11Z")

</div>

I am so sorry! and thank you for correcting the title 🙏

---

<div class="post-metadata">

**Author:** ![Rez\_S](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rez\_S](https://forum.inductiveautomation.com/u/Rez_S)\
**Post date:** [November 21, 2024, 7:38pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/5 "2024-11-21T19:38:49Z")

</div>

Oh, nice! that's good news.  
but as this is a custom module, I was wondering what part could be wrong @paul-griffith  
this is my Kafka producer config:

```python
 put("bootstrap.servers", settingsRecord.getKafkaServer());
            put("sasl.jaas.config", String.format("org.apache.kafka.common.security.plain.PlainLoginModule required username='%s' password='%s';", settingsRecord.getSaslUsername(), settingsRecord.getSaslPassword()));
            put("client.dns.lookup", "use_all_dns_ips");
            put("session.timeout.ms", 45000);
            put("acks", "all");
            put("security.protocol", "SASL_SSL");
            put("sasl.mechanism", "PLAIN");

```

could it be, that port 9092 is not open on the server ignition is running on?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 21, 2024, 9:09pm UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/6 "2024-11-21T21:09:57Z")

</div>

I dunno, maybe?

My point is you're connecting a client you're authoring to a server you own/control. Ignition has ~nothing to do with this process. You're making an outbound connection, so Ignition's ports (which you're in control of also) are almost certainly not relevant unless Kafka works in some particularly weird way.

---

<div class="post-metadata">

**Author:** ![jimender2](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jimender2](https://forum.inductiveautomation.com/u/jimender2)\
**Post date:** [December 2, 2024, 5:55am UTC](https://forum.inductiveautomation.com/t/kafka-publish-to-broker-error/98929/7 "2024-12-02T05:55:54Z")

</div>

> **[GitHub - IgnitionModuleDevelopmentCommunity/Kafka: Kafka extension for Ignition](https://github.com/IgnitionModuleDevelopmentCommunity/Kafka)**
>
> Kafka extension for Ignition

Might be worth checking this out. I know when we did implemented kafka (not in the above code), we did have to provide references to the correct trust stores and keystores.
