To connect a client to an ApsaraMQ for Kafka instance, you need the correct endpoint for your network type and security requirements. This topic describes the available endpoint types and shows you how to find them in the ApsaraMQ for Kafka console.
Endpoint types
ApsaraMQ for Kafka provides three endpoint types:
| Endpoint type | Network | SASL authentication | Encryption | Use case |
|---|---|---|---|---|
| Default endpoint | VPC | No | No | VPC-internal messaging without client-level authentication |
| SASL endpoint | VPC | Yes | No | VPC-internal messaging with client-level authentication |
| SSL endpoint | Internet | Yes | Yes (TLS) | Internet messaging with encryption and authentication |
For a detailed comparison, see Comparison among endpoints.
Endpoints displayed by instance type
The endpoints available in the console depend on your instance configuration:
| Instance type | Endpoints displayed |
|---|---|
| VPC-connected | Default endpoint |
| Internet- and VPC-connected | Default endpoint, SSL endpoint |
SASL endpoints are not enabled by default. To use SASL endpoints, enable them through the ACL feature. For more information, see Use the ACL feature for access control.
Endpoint format
Endpoints use the following format:
<Instance domain name>:<Port number>Legacy instances may still display endpoints in the <Broker IP address>:<Port number> format. To ensure long-term stability, migrate to the domain name format. See the "Migrate a legacy endpoint to domain name format" section below.
Find your endpoint in the console
Log in to the ApsaraMQ for Kafka console.
In the Resource Distribution section of the Overview page, select the region where your instance resides.
On the Instances page, click the name of the instance.
On the Instance Details page, click the Instance Information tab.
In the Endpoint Information section, find the endpoint in the Domain Name column.
Migrate a legacy endpoint to domain name format
If your instance still uses the legacy <Broker IP address>:<Port number> format, migrate to the domain name format for long-term stability:
On the Instance Details page, click the Instance Information tab.
In the Endpoint Information section, click Enable Domain Name Feature in the Actions column.
In the Enable Domain Name Feature confirmation dialog box, click Enable.
Find the new endpoint in the Domain name column.
After migration, you can still view the original IP-based endpoint by hovering over the domain name.
Connect a client with the endpoint
After you get the endpoint, use an SDK to connect a client to your ApsaraMQ for Kafka instance. For more information, see SDK overview.
If your instance connects to a VPC through a leased line, set the DNS record addresses to 100.100.2.136 and 100.100.2.138 before you use an SDK to access the instance.