Connecting Kafka clients
Connect your Kafka client to a Cloudera Streams Messaging cluster in Cloudera Anywhere Cloud using the client configuration bundle from Cloudera Surveyor and the client credentials you generate.
Kafka clusters deployed with Cloudera Streams Messaging in Cloudera Anywhere Cloud use OAuth over TLS/SSL for external client access. To connect
successfully, your local client configuration must match the OAuth authentication and TLS/SSL
encryption (SASL_SSL) settings applied to the cluster during deployment.
Cloudera Surveyor provides a client configuration bundle on the Client Configurations tab for your cluster. The bundle includes a client properties file (external.properties), CA certificates, and connection instructions.
To complete the connection, you generate OAuth client credentials, download and extract the bundle, fill in the credential placeholders in external.properties, configure the OAuth token endpoint allowlist on your JVM, and connect your client.
When you perform this task, the Anywhere Cloud Console user you are logged in as determines what your Kafka client will be authorized to access. The client credentials you generate are strictly bound to that user's principal. Therefore, your client will have the same access as the user you are logged in as. This is because when your Kafka client connects, Apache Ranger evaluates authorization against this specific principal, instead of a separate, dedicated client identity.
Because of this direct binding, the user you log in as must explicitly exist in Ranger and have the appropriate Kafka policies assigned. Completing Ranger setup for the cluster does not grant every user access. If an administrator has not added the user you log in as to the required Ranger policies, your client connection might be denied.
When you test your first connection, log in to Anywhere Cloud Console as a user that you know has the Ranger permissions for the operations you want to verify. The steps in this task use listing topics as an example. Alternatively, for ongoing application workloads, you can log in to Anywhere Cloud Console as a dedicated identity provider account configured with the exact permissions your application requires.
-
You deployed and have access to an instance of Cloudera Streams Messaging, if not see Deploying Cloudera Streams Messaging.
-
You have your own Kafka client application that you can configure to connect to your newly deployed brokers. The client must use version 4.1 or later of the
kafka-clientslibrary.Alternatively, you have access to Apache Kafka command-line tools. If not, download the Kafka binaries from https://kafka.apache.org/community/downloads/. Cloudera recommends you download the latest available binaries (version 4.1 or later is required).
The command-line tools are located in the bin directory of the downloaded archive. These steps will use kafka-topics.sh as an example to verify your connection. These steps also assume that Kafka command-line tools are available on your
PATH. -
You must have access to a Bash-compatible shell environment with
curl. -
Ranger policies are configured for Kafka. See Configuring Ranger policies for Cloudera Streams Messaging.
-
Perform the steps in this task while logged in to Anywhere Cloud Console as the user whose Kafka access the client should have.
