Skip to main content

Connect to Apache Kafka® cluster using SASL protocol

This section provides information on connecting Klaw to an Apache Kafka cluster using SSL protocol.


  • Set up the connection between the Klaw APIs (Klaw Core API and Klaw Cluster API), see klaw-core-with-clusterapi. This involves configuring the klaw.clusterapi.url setting in the Klaw UI and testing the connectivity to ensure the two APIs can communicate.

Configure and connect using SASL protocol

Follow the steps below to configure and connect to an Apache Kafka cluster in Klaw using SASL_SSL protocol:

  1. In the Klaw web interface, navigate to Environments, and click Clusters.

  2. On the Clusters page, click Add Cluster.

  3. On the Add Kafka cluster page, enter the following details:

    • Cluster Type: Select Kafka from the drop-down list
    • Cluster Name: Provide a name for the cluster
    • Protocol: Select SASL_SSL protocol for your cluster
    • Kafka Flavor: Select Apache Kafka as the flavor
    • Bootstrap server: Enter the bootstrap server details for an Apache Kafka cluster.
  4. Click Save.

  5. Add the cluster to the preferred environment. Click Environments from the Environments drop-down menu.

  6. Click Add Environment and enter the details to add your Apache Kafka environment.

  7. Enter an environment name, select the added cluster from the drop-down list, and configure partitions, replication factor, and tenant (set to default).

  8. Copy the Cluster ID from the Clusters page using the copy icon that is available on the right-hand side of each cluster row.

  9. Open the file located in the cluster-api directory.

  10. Depending on your SASL mechanism, copy one of the below properties, replace clusterid with the copied cluster id, and save the file.

    2a3d24b (Fix markdownlint errors and adapt config.)
    required username='kwuser' password='kwuser-secret';
    required username='kwuser' password='kwuser-secret';
    required useKeyTab=true storeKey=true
  11. Add relevant ACLs on the Apache Kafka cluster (IP/Principal based) to authorize Klaw to create topics and ACLs. This can be done using: :

    --operation All --clusterCluster:kafka-cluster --topic "*"

  12. Re-deploy the Klaw Cluster API with the updated configuration. This will apply the changes and enable Klaw to connect to the Apache Kafka cluster using SSL protocol.