All Products
Search
Document Center

ApsaraMQ for Kafka:Step 3: Create resources

Last Updated:Mar 11, 2026

Before you send or receive messages with ApsaraMQ for Kafka, create topics and consumer groups on your deployed instance. Producers send messages to topics. Consumers read messages from topics through consumer groups. Before consumers can consume messages, the consumer group must subscribe to the corresponding topics. A consumer group can subscribe to multiple topics, and a topic can serve multiple consumer groups.

Prerequisites

Before you begin, make sure that you have:

Step 1: Create a topic

Important

Create topics in the same region as the Elastic Compute Service (ECS) instance where your producers and consumers run. Topics cannot be used across regions. For example, if your ECS instance is in the China (Beijing) region, the topic must also be in the China (Beijing) region.

  1. Log on to the ApsaraMQ for Kafka console.

  2. In the Resource Distribution section of the Overview page, select the region where your instance is deployed.

  3. On the Instances page, click the name of your instance.

  4. In the left-side navigation pane, click Topics.

  5. On the Topics page, click Create Topic.

  6. In the Create Topic panel, configure the following parameters and click OK. After the topic is created, it appears on the Topics page.

    ParameterDescriptionExample
    NameThe topic name.demo
    DescriptionA brief description of the topic.demo test
    PartitionsThe number of partitions.12
    Storage EngineThe storage engine type. Available only for Professional Edition instances. Standard Edition defaults to Cloud Storage. For details, see the Storage engine options section below.Cloud Storage
    Message TypeThe message ordering behavior. Automatically determined by the storage engine. For details, see the Message type options section below.Normal Message
    Log Cleanup PolicyRequired only when Storage Engine is Local Storage (Professional Edition). For details, see the Log cleanup policy options section below.Delete
    TagTags to attach to the topic.demo
Note

The system automatically creates two internal topics when you deploy an instance: __alikafka_housekeeping_local_topic and __alikafka_housekeeping_cloud_topic. Do not delete these topics. For more information, see Inspection description.

Storage engine options

Note

This parameter is available only for Professional Edition instances. Standard Edition instances use Cloud Storage by default.

  • Cloud Storage: Stores messages on Alibaba Cloud disks with three replicas in distributed mode. Provides low latency, high performance, high durability, and high reliability. If you set Instance Edition to Standard (High Write) during instance creation, only Cloud Storage is available.

  • Local Storage: Uses the in-sync replicas (ISR) algorithm from open source Apache Kafka. Stores data in three replicas in distributed mode.

Message type options

  • Normal Message: Messages with the same key are stored in the same partition in send order. If a broker fails, message ordering across partitions may not be preserved. Automatically set when Storage Engine is Cloud Storage.

  • Partitionally Ordered Message: Messages with the same key are stored in the same partition in send order. If a broker fails, ordering is preserved, but some partitions become unavailable until the broker recovers. Automatically set when Storage Engine is Local Storage.

Log cleanup policy options

Required only when Storage Engine is Local Storage (Professional Edition only).

  • Delete (default): Retains messages based on the maximum retention period. When storage usage exceeds 85%, the system deletes the earliest messages to maintain service availability.

  • Compact: Applies the log compaction policy from Apache Kafka. Retains only the latest value for each message key. Use this policy for components that store state or configuration data, such as Kafka Connect and Confluent Schema Registry. For more information, see aliware-kafka-demos.

    Important

    Log-compacted topics are supported only for specific cloud-native components such as Kafka Connect and Confluent Schema Registry.

Step 2: Create a consumer group

  1. Log on to the ApsaraMQ for Kafka console.

  2. In the Resource Distribution section of the Overview page, select the region where your instance is deployed.

  3. On the Instances page, click the name of your instance.

  4. In the left-side navigation pane, click Groups.

  5. On the Groups page, click Create Group.

  6. In the Create Group panel, enter a group name in the Group ID field and a description in the Description field, attach tags if needed, and click OK. After the consumer group is created, it appears on the Groups page.

What's next

After creating topics and consumer groups, use an SDK to produce and consume messages. See Step 4: Use an SDK to send and receive messages.

Related topics