All Products
Search
Document Center

ApsaraMQ for Kafka:Enable automatic Group creation

Last Updated:Mar 11, 2026

When migrating Kafka workloads to the cloud or iterating in development, creating consumer Groups manually in the console slows you down. The Flexible Group Creation feature eliminates this step -- Groups are created automatically when a consumer connects with a group.id that does not yet exist.

ApproachWhen to use
Enable automatic Group creation (this guide)Cloud migration, development, or testing. No console steps needed.
Create Groups manuallyProduction. Full control over resource allocation and naming. See Create a Group or the CreateConsumerGroup API.
Important

Do not leave automatic Group creation enabled long-term in production. Misconfigured clients can cause uncontrolled resource consumption, increasing O&M costs and risking system instability.

Prerequisites

Before you begin, make sure that your ApsaraMQ for Kafka instance meets the following requirements:

RequirementValue
StatusRunning
Major version2.2.0
Minor versionLatest
Note

Check the instance status and version in the Basic Information section on the Instance Details page.

Enable the feature

  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 the instance.

  4. In the Configuration Information section, turn on the Flexible Group Creation switch.

Consume messages with an auto-created Group

Set group.id to a name that does not yet exist. The Group is created automatically on the first poll.

props.put(ConsumerConfig.GROUP_ID_CONFIG, "newConsumerGroup");
consumer.subscribe(Collections.singletonList("newTopicName"));
// If the Group does not exist and its name is valid, it is automatically created.
consumer.poll(Duration.ofSeconds(1));

This works with any consumer SDK that supports the standard group.id property.

Disable the feature

Review the following before turning off automatic Group creation:

ConsiderationDetails
Existing consumers are affectedGroups not created through the console can no longer consume messages or commit offsets after the feature is disabled. Disable with caution.
Disabling is asynchronousThe instance status changes to Upgrading during the process and returns to In Service after completion. Nodes are not restarted.
Do not create Groups during the transitionAvoid creating new Groups automatically while the feature is being disabled.

To disable the feature, return to the Configuration Information section on the Instance Details page and turn off the Flexible Group Creation switch.

Group naming rules

Auto-created Group names must follow these rules:

RuleValue
Length3 to 128 characters
Allowed charactersLetters, digits, hyphens (-), and underscores (_)
Additional requirementAt least one letter or digit

Limits

  • The number of automatically created Groups cannot exceed your instance specification limit. After the limit is reached, no new Groups can be created automatically. For details, see Limits.

  • The server cleans up auto-created Groups after their consumer offsets expire.

Identify auto-created Groups in the console

  • Auto-created Groups are listed on the Groups page with the description "Automatically created."

  • The Auto Creation column for these Groups is set to Yes.

Assign-mode offset commits

Even without the Flexible Group Creation feature enabled, committing consumer offsets using the Assign method creates a corresponding Group on the Kafka cluster. This behavior is enabled by default. To disable it, submit a ticket.

See also