Experience AutoMQ for Kafka
After completing the environment setup and initialization, this article demonstrates how to quickly create a Kafka instance and experience message sending and receiving.
In this article, references to AutoMQ Product Service Provider, AutoMQ Service Provider, and AutoMQ specifically refer to AutoMQ HK Limited.
Prerequisites
Before creating a Kafka instance, ensure you have met the prerequisites and completed the environment installation. If not, follow the steps here:
Creating an Instance
To experience AutoMQ for Kafka, you need to create an instance first. Each instance corresponds to an open-source Apache Kafka cluster. Users can create instances through the front-end interface of the environment console, while the backend of the console will create the underlying cloud resources and complete the software deployment of the instance on behalf of the user.
The steps are as follows:
Access the environment console URL and enter the environment console.
Enter the environment console, click on the left navigation bar, and navigate to the instance list.
Click the "Create New Instance" button and select parameters according to the following specifications.
Parameter | Value Description |
---|---|
Instance Name |
|
Instance Notes |
|
Availability Zone Information |
|
Subnet Information |
|
Computing Specifications |
|
Storage Specifications |
|
- Click "Create Instance" and wait for the instance creation to complete.
Experience Sending and Receiving Messages
After the instance is created, you need to create a Topic before experiencing simple message sending and receiving. Follow these steps:
Click "Instance Details" to enter the instance, then click the "Topic" navigation bar on the left.
Click "New Topic," fill in the relevant parameters, and create the topic.
Click the topic name to enter the topic details, then click the "Produce Message" tab.
Fill in the test message content and click "Send" to complete the feature experience.
Next Steps
This quick start guide only demonstrates the basic process from environment creation to instance creation. AutoMQ Kafka is 100% compatible with Apache Kafka®, so for actual usage of AutoMQ Kafka, please refer to the relevant Apache Kafka documentation and knowledge base.
If there is no business need after the quick experience and testing, it is recommended to release the environment as soon as possible to avoid incurring costs from underlying cloud resource consumption.
Appendix: Cross-VPC Access to AutoMQ
AutoMQ instances provide VPC internal domain name resolution and private network addresses by default through PrivateDNS, serving only the current VPC. If an application needs to access AutoMQ across VPCs, you will need to configure the network yourself, meeting the following two conditions:
Condition 1: VPC Intercommunication: Users can connect the VPC where AutoMQ is located with the VPC where the application is located through methods such as VPC Peering, to access AutoMQ instances. Please refer to the cloud provider's VPC operation documents for configuring VPC Peering.
Condition 2: Private Zone Associated with Multiple VPCs: AutoMQ provides domain name resolution through Private Zone by default, which is limited to the current VPC. To resolve domain names across VPCs, the Private Zone used by AutoMQ needs to be additionally associated with the VPC where the application resides.
Private Zone Multiple VPCs Association Configuration Instructions
- AWS Route53
To configure a zone to associate with multiple VPCs in the AWS Route 53 product, refer to the following steps.
- Locate the Private Zone Id used by AutoMQ.
Copy the endpoint address of the AutoMQ console instance, remove the domain prefix to obtain the Private Zone, and then go to the Route53 Console to search for the Zone.
Enter the Zone details page to view the copied Hosted Zone Id.
- Scenario 1: Edit Hosted Zone and add the VPC of this account.
- Scenario 2: Add a cross-account VPC using AWS CLI.
If you need to add a cross-account VPC, it cannot be done through the console page; it must be completed through AWS CLI or SDK.
Assume that AutoMQ is deployed in account A's vpc-a, and it is necessary to associate account B's vpc-b to use AutoMQ. The specific steps are as follows:
Log in to AWS CLI using account A and create a DNS association authorization.
aws route53 create-vpc-association-authorization --hosted-zone-id XXXXX --vpc VPCRegion=XXXX,VPCId=vpc-b
Parameter description:
hosted-zone-id: Fill in the Zone ID of the Zone used by AutoMQ under account A.
vpc: Enter the VPC information for account B; it must be encoded in the format “VPCRegion=XXXX,VPCId=XXXX”.
After pressing enter, detailed information will be displayed. Enter “:wq” to submit the command.
Log in to AWS CLI with account B and create a DNS association request.
aws route53 associate-vpc-with-hosted-zone --hosted-zone-id XXXX --vpc VPCRegion=xxx,VPCId=vpc-b
Parameter explanation:
hosted-zone-id: Fill in the Zone ID of the Zone used by AutoMQ under account A.
vpc: Fill in the VPC information for Account B, which must be encoded in the format "VPCRegion=XXXX,VPCId=XXXX".
After pressing enter, detailed information will be output. Enter ":wq" to submit the command, then check the console where Account A is logged in to see the addition is completed.
Adding a new VPC to the Route 53 Zone takes 3-5 minutes to take effect. Once it is effective, you can resolve the domain name of AutoMQ within the application’s VPC.