Kafka inbound connector fails in infinite loop

Hello! We have a problem with inbound kafka connector. We just started to play with it and can make mistakes but we deploy a process with out of the box inbound kafka connector, specified wrong sasl mechanism and consumer fell to infinite fail loop:

2025-08-29 18:54:10.425	
2025-08-29T15:54:10.425Z ERROR 1 --- [pool-6-thread-1] i.c.c.k.inbound.KafkaConnectorConsumer   : Failed to close consumer before retrying, reason: Cannot invoke "org.apache.kafka.clients.consumer.Consumer.close()" because "this.consumer" is null. This error will be ignored. If the consumer is still running, it will be disconnected after max.poll.interval.ms.
2025-08-29 18:54:10.425	
2025-08-29T15:54:10.425Z ERROR 1 --- [pool-6-thread-1] i.c.c.k.inbound.KafkaConnectorConsumer   : Consumer loop failure, retry pending: Invalid value SASL_PLAIN for configuration security.protocol: String must be one of (case insensitive): SASL_SSL, PLAINTEXT, SSL, SASL_PLAINTEXT
2025-08-29 18:54:10.425	
2025-08-29T15:54:10.425Z ERROR 1 --- [pool-6-thread-1] i.c.c.k.inbound.KafkaConnectorConsumer   : Failed to initialize connector: Invalid value SASL_PLAIN for configuration security.protocol: String must be one of (case insensitive): SASL_SSL, PLAINTEXT, SSL, SASL_PLAINTEXT

This picture repeats every 30 seconds.

Deletion of the process does not work, error still appears. We work in self managed environment. How can we manage this? How to stop the consumer trying to start? Thanks in advance!

Hello! I can help you resolve this Kafka inbound connector issue. You’re experiencing a common problem where the connector gets stuck in an error loop due to a configuration issue.

Problem Classification: Problem

Based on your error logs, the issue is clear:

Root Cause: You’ve configured SASL_PLAIN as the security.protocol, but this is incorrect. The valid values for security.protocol are:

  • SASL_SSL
  • PLAINTEXT
  • SSL
  • SASL_PLAINTEXT

Why Deleting the Process Doesn’t Stop the Errors

In self-managed Camunda 8, deleting a process definition only deactivates the connector for that specific process, but does not stop the connector runtime itself. The connector runtime is a separate application/service that continues running independently. This is why you’re still seeing the error logs every 30 seconds.

Solutions

Option 1: Fix the Configuration (Recommended)

  1. Correct the security protocol in your Kafka connector configuration:

    • If using SASL with SSL: use SASL_SSL
    • If using SASL without SSL: use SASL_PLAINTEXT
  2. Use Additional Properties to override the default settings. In your connector configuration, add this to the Additional properties field:

    = {
      "security.protocol": "SASL_PLAINTEXT",
      "sasl.mechanism": "PLAIN"
    }
    

    (Adjust SASL_PLAINTEXT to SASL_SSL if you need SSL)

  3. Redeploy your process with the corrected configuration.

Option 2: Stop the Connector Runtime Manually

Since deleting the process doesn’t stop the connector runtime, you need to manually stop it:

  • If using Docker: Stop the connector runtime container
  • If using standalone JAR: Kill the Java process
  • If using Kubernetes: Scale down the connector runtime deployment or restart the pods

Option 3: Restart Your Camunda 8 Environment

If you’re using Camunda 8 Run or a local setup, restart the entire environment to stop all connector runtimes.

Prevention Tips

  • Always test connector configurations with valid parameters first
  • Use the “Consume unmatched events” option to prevent message processing loops
  • Refer to the Kafka connector documentation for proper configuration examples

The key takeaway is that connector runtimes run independently of process deployments in self-managed environments, so you need to manage them separately when issues occur.

Let me know if you need help with any of these steps!