This document describes the features and use cases of cluster consumption and broadcast consumption in TDMQ for RocketMQ.
Cluster consumption is suitable for scenarios where each message only needs to be processed once.
Broadcast consumption is suitable for scenarios where each message needs to be processed by each consumer in the cluster.
// Set the cluster subscription mode (which is the default mode if you don't specify one) properties.put(PropertyKeyConst.MessageModel, PropertyValueConst.CLUSTERING);
// Set the broadcast subscription mode properties.put(PropertyKeyConst.MessageModel, PropertyValueConst.BROADCASTING);
You need to ensure that all consumer instances under the same group ID have the same subscription relationships.