Connect to a Kafka Cluster with Confluent for VS Code¶
The following steps show how to connect Confluent for VS Code to an Apache Kafka® cluster. To connect to Confluent Platform, see Quick Start with Confluent Platform.
Prerequisites¶
- Confluent for VS Code: Follow the steps in Install VS Code
- A running Kafka cluster
With Confluent for VS Code, you can connect to any Kafka API-compatible cluster and any Confluent Schema Registry API-compatible server.
Prerequisites¶
- VS Code: Follow the steps in Install VS Code.
- An Kafka-API compatible cluster: For more information see Kafka Protocol Guide
Create a new connection¶
Open VS Code.
In the VS Code Activity Bar, click the Confluent icon. If you have many extensions installed, you may need to click … to access Additional Views and select Confluent from the context menu.
In the Side Bar, click + Add New Connection in the Resources section.
In the Command Palette, select Enter manually.
The extension shows the Create a new connection page.
Enter connection details¶
In the Create a new connection page, enter the details for your Kafka cluster.
In the General section, enter the name of the connection and select the type of connection.
- Connection Name: An easy-to-remember name to display in the Resources view.
- Connection Type: In the dropdown, choose one of the following values:
- Apache Kafka®
- Confluent Cloud
- Confluent Platform
- Warpstream
- Other
In the Kafka Cluster section, enter the bootstrap server and authentication details.
Confluent for VS Code supports authenticating to Kafka with most of the commonly used SASL authentication mechanisms.
Bootstrap Server(s): One or more
host:port
pairs to use for establishing the initial connection. For more than one server, use a comma-separated list.Authentication Type: In the dropdown, choose one of the following values:
- Username & Password (SASL/PLAIN)
- API Credentials (SASL/PLAIN)
- SASL/SCRAM (supports both
SCRAM-SHA-256
andSCRAM-SHA-512
) - SASL/OAUTHBEARER
- Kerberos (SASL/GSSAPI)
Note
To use Mutual TLS (mTLS) authentication, expand the TLS Configuration section and enter Key Store and Trust Store details.
Verify Server Hostname: Enable verification of the Kafka/Schema Registry host name matching the Distinguished Name (DN) in the broker’s certificate.
Key Store Configuration: Certificate used by Kafka/Schema Registry to authenticate the client. This is used to configure mTLS authentication.
- Path: The path of the Key Store file.
- Password: The store password for the Key Store file. Key Store password is not supported for PEM format.
- Key Password: The password of the private key in the Key Store file.
- Type: The file format of the Key Store file. Choose from PEM, PKCS12 and JKS.
Trust Store Configuration: Certificates for verifying SSL/TLS connections to Kafka/Schema Registry. This is required if Kafka/Schema Registry use a self-signed or a non-public Certificate Authority (CA).
- Path: The path of the Trust Store file.
- Password: The password for the Trust Store file. If a password is not set, the configured Trust Store file is used, but integrity checking of the Trust Store file is disabled. Trust Store password is not supported for PEM format.
- Key Password: The password of the private key in the Trust Store file.
- Type: The file format of the Trust Store file. Choose from PEM, PKCS12 and JKS.
Confluent Cloud uses TLS certificates from Let’s Encrypt, a trusted Certificate Authority (CA). Confluent Cloud does not support self-managed certificates for TLS encryption. For more information, see Manage TLS Certificates.
In the Schema Registry section, enter the URL of the Schema Registry to use for serialization.
Click the Authentication Type dropdown and choose one of the following values:
- Username & Password
- API Credentials
- OAuth
To use Mutual TLS (mTLS) authentication, expand the TLS Configuration section and enter Key Store and Trust Store details, as shown in the previous step.
Test and save your connection¶
Click Test to test your connection.
Click Save to save the connection. You can save the connection configuration even if the test wasn’t successful.
Confirm that your connected resources are displayed in the Side Bar.