Embedded Kafka always uses plaintext for communicating to brokers

See original GitHub issue

Hi,

I posted this issue on stack overflow creating an embedded SASL_SSL enabled kafka. It appears that right now, the Embedded kafka is designed to only ever use the plaintext protocol for it’s broker communication. This might not always be the case, depending on how people might want to set up their test environment. It can be fixed by something like below:

if (this.kafkaPorts[i] == 0) {
      this.kafkaPorts[i] = TestUtils.boundPort(server, SecurityProperties.forName(this.brokerProperties.getOrDefault("security.protocol", SecurityProtocol.PLAINTEXT).toString()); // or whatever property provides security protocol I should be using to communicate.
}

as opposed to

if (this.kafkaPorts[i] == 0) {
    this.kafkaPorts[i] = TestUtils.boundPort(server, SecurityProtocol.PLAINTEXT);
}

in EmbeddedKafkaBroker.java

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
garyrussellcommented, Feb 21, 2022

@rgmprabodha We have no intention to add SSL etc to the embedded broker - it is only intended for integration testing so there is no real value in adding the complexity.

If you absolutely need it, consider using TestContainers instead.

0reactions
rgmprabodhacommented, Feb 21, 2022

Do you have any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SASL_SSL integration with EmbeddedKafka - Stack Overflow
The embedded kafka is configured to only use PLAINTEXT protocol to communicate to the broker. 2.) Zookeeper options are not configurable ...
Read more >
Configuring PLAIN - Confluent Documentation
If you want to enable SASL for interbroker communication, add the following to the broker properties file (it defaults to PLAINTEXT ). Set...
Read more >
Testing Kafka and Spring Boot - Baeldung
First, we'll start by looking at how to use and configure an embedded instance of Kafka. Then we'll see how we can make...
Read more >
Documentation - Apache Kafka
The ConsoleProducer no longer supports the Scala producer, it always uses the Java ... Kafka Streams is more robust against broker communication errors....
Read more >
When NOT to use Apache Kafka? - Kai Waehner
The edge is here to stay and grow. Some use cases require the deployment of a Kafka cluster or single broker outside a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found