Configure the ApsaraMQ for RocketMQ .NET SDK to connect to your instance, send messages, and consume messages. Parameters are grouped by scope: common parameters apply to all clients, while producer and consumer parameters apply to their respective roles.
Common parameters
These parameters are required for both producers and consumers.
| Parameter | Required | Description | Default |
|---|---|---|---|
NAMESRV_ADDR | Yes | TCP endpoint of your ApsaraMQ for RocketMQ instance. Get this value from the Instances page in the ApsaraMQ for RocketMQ console. | N/A |
AccessKey | Yes | AccessKey ID for identity authentication. For more information, see Create an AccessKey pair. | N/A |
SecretKey | Yes | AccessKey secret, used as the password for identity authentication. For more information, see Create an AccessKey pair. | N/A |
OnsChannel | No | User channel. Set to CLOUD only if you are a CloudTmall user. | ALIYUN |
Producer parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
ProducerId | Yes | Group ID of the producer, created in the ApsaraMQ for RocketMQ console. For more information, see Terms. | N/A |
SendMsgTimeoutMillis | No | Message sending timeout in milliseconds. | 3000 |
shardingKey | Conditional | Sharding key for ordered messages. Required when you send ordered messages. | N/A |
Consumer parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
ConsumerId | Yes | Group ID of the consumer, created in the ApsaraMQ for RocketMQ console. For more information, see Terms. | N/A |
MessageModel | No | Consumption model for the consumer instance. Valid values: CLUSTERING -- clustering consumption. BROADCASTING -- broadcasting consumption. | CLUSTERING |
ConsumeThreadNums | No | Number of concurrent consumption threads per consumer instance. | 20 |
Related topics
该文章对您有帮助吗?