tencent cloud

TDMQ for RocketMQ

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Introduction and Selection of the TDMQ Product Series
What Is TDMQ for RocketMQ
Strengths
Scenarios
Product Series
Comparison with Open-Source RocketMQ
High Availability
Quotas and Limits
Supported Regions
Basic Concepts
Billing
Billing Overview
Pricing
Billing Examples
Pay-as-you-go Switch to Monthly Subscription (5.x)
Renewal
Viewing Consumption Details
Refund
Overdue Payments
Getting Started
Getting Started Guide
Preparations
Step 1: Creating TDMQ for RocketMQ Resources
Step 2: Using the SDK to Send and Receive Messages (Recommended)
Step 2: Running the TDMQ for RocketMQ Client (Optional)
Step 3: Querying Messages
Step 4: Deleting Resources
User Guide
Usage Process Guide
Configuring Account Permissions
Creating the Cluster
Configuring the Namespace
Configuring the Topic
Configuring the Group
Connecting to the Cluster
Managing Messages
Managing the Cluster
Viewing Monitoring Data and Configuring Alarms
Cross-Cluster Message Replication
Use Cases
Naming Conventions for Common Concepts of TDMQ for RocketMQ
RocketMQ Client Use Cases
RocketMQ Performance Load Testing and Capacity Assessment
Access over HTTP
Client Risk Descriptions and Update Guide
Migration Guide for TencentCloud API Operations Related to RocketMQ 4.x Cluster Roles
Migration Guide
Disruptive Migration
Seamless Migration
Developer Guide
Message Types
Message Filtering
Message Retries
POP Consumption Mode (5.x)
Clustering Consumption and Broadcasting Consumption
Subscription Relationship Consistency
Traffic Throttling
​​API Reference(5.x)
History
API Category
Making API Requests
Topic APIs
Consumer Group APIs
Message APIs
Role Authentication APIs
Hitless Migration APIs
Cloud Migration APIs
Cluster APIs
Data Types
Error Codes
​​API Reference(4.x)
SDK Reference
SDK Overview
5.x SDK
4.x SDK
Security and Compliance
Permission Management
CloudAudit
Deletion Protection
FAQs
4.x Instance FAQs
Agreements
TDMQ for RocketMQ Service Level Agreement
Contact Us
DocumentationTDMQ for RocketMQDeveloper GuideClustering Consumption and Broadcasting Consumption

Clustering Consumption and Broadcasting Consumption

PDF
Focus Mode
Font Size
Last updated: 2026-01-23 17:52:23
This document mainly introduces the features and scenarios of clustering consumption and broadcasting consumption in TDMQ for RocketMQ.

Feature Introduction

Clustering consumption: In the clustering consumption mode, each message only needs to be processed by any of the consumers in the cluster.
Broadcasting consumption: In the broadcasting consumption mode, each message is pushed to all registered consumers in the cluster to ensure that the message is consumed at least once by each consumer.

Scenarios

Clustering consumption: Suitable for scenarios where each message only needs to be processed once.
Broadcasting consumption: Suitable for scenarios where each message needs to be processed by every consumer in the cluster.

Sample Code

Clustering subscription
5.x SDK
4.x SDK
The 5.0 SDK uses the clustering consumption mode by default, requiring no special configuration.
Note:
Make sure that the subscription relationships are consistent across all consumer instances under the same group ID.
All consumers identified by the same group ID share the consumption of messages on average. For example, if a topic has 9 messages and a group ID has 3 consumer instances, in the clustering consumption mode, each instance shares the load equally and consumes only 3 of those messages.
// Set the clustering subscription mode (this is the default mode if not set).
properties.put(PropertyKeyConst.MessageModel, PropertyValueConst.CLUSTERING);
Broadcast subscription
5.x SDK
4.x SDK
The 5.0 SDK no longer supports broadcasting consumption. If you need to use the mode, you can create a separate subscription group for each consumer to achieve similar functionality.
Note:
Make sure that the subscription relationships are consistent across all consumer instances under the same group ID.

All consumers identified by the same group ID will each consume every message once. For example, if a topic has 9 messages and a group ID has 3 consumer instances, in the broadcasting consumption mode, each instance will consume all 9 messages.
// Set the broadcast subscription mode.
properties.put(PropertyKeyConst.MessageModel, PropertyValueConst.BROADCASTING);
Note
Make sure that the subscription relationships are consistent across all consumer instances under the same group ID.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback