To connect a producer or consumer to an ApsaraMQ for Kafka instance, you need the endpoint that matches your network type and authentication requirements. Each instance exposes one or more endpoints in domain:port format. The following sections describe the available endpoint types and how to find them in the console.
Endpoint types
ApsaraMQ for Kafka provides three endpoint types. Choose one based on how your client connects to the instance.
| Endpoint type | Network | SASL authentication | When to use |
|---|---|---|---|
| Default endpoint | VPC | Not supported | Connect from within a Virtual Private Cloud (VPC) without authentication |
| SASL endpoint | VPC | Supported | Connect from within a VPC with Simple Authentication and Security Layer (SASL) authentication |
| SSL endpoint | Internet | Supported | Connect over the public internet with SASL authentication and TLS encryption |
The endpoints displayed for your instance depend on its network configuration:
VPC-connected instance: Only the default endpoint is displayed.
Internet- and VPC-connected instance: Both the default endpoint and the SSL endpoint are displayed.
The endpoints of serverless ApsaraMQ for Kafka instances are also displayed in domain:port format.
For a detailed comparison, see Comparison among endpoints.
Find your endpoint in the console
Prerequisites
Before you begin, make sure that you have:
An ApsaraMQ for Kafka instance in the target region
Access to the ApsaraMQ for Kafka console
Steps
Log on 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 your instance.
In the Instance Details section of the Endpoint Information page, locate the endpoint for your network type. Copy the endpoint value in
domain:portformat.
Connect with the endpoint
After you get the endpoint, use it to connect a Kafka client to your instance. For complete instructions on supported languages and configuration, see SDK overview.
If your instance connects to a VPC through a leased line, update the DNS record addresses to 100.100.2.136 and 100.100.2.138 before connecting with an SDK.