I am trying to connect the confluent Kafka broker using "SASL_PLAINTEXT" or "PLAINTEXT" but I am getting this error broker transport failure. However, it's working fine with the "SASL_SSL" protocol but not working with any other security protocol.
Here is my code.
const consumer = new Kafka.KafkaConsumer({
'group.id':'gsuite_consumer',
'metadata.broker.list': *******,
'sasl.mechanisms': 'PLAIN',
'sasl.username': *********,
'sasl.password': ******,
'security.protocol': 'PLAINTEXT'
}, {});
// Connect the consumer.
consumer.connect({timeout: "1000ms"}, (err) => {
if (err) {
console.log(`Error connecting to Kafka broker: ${err}`);
process.exit(-1);
}
console.log("Connected to Kafka broker");
});
Any idea what's am I doing wrong? here to connect with the broker. I have also deployed this code on Heroku server as well and it's not working