.NET SDK parameters

更新时间:
复制 MD 格式

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.

ParameterRequiredDescriptionDefault
NAMESRV_ADDRYesTCP endpoint of your ApsaraMQ for RocketMQ instance. Get this value from the Instances page in the ApsaraMQ for RocketMQ console.N/A
AccessKeyYesAccessKey ID for identity authentication. For more information, see Create an AccessKey pair.N/A
SecretKeyYesAccessKey secret, used as the password for identity authentication. For more information, see Create an AccessKey pair.N/A
OnsChannelNoUser channel. Set to CLOUD only if you are a CloudTmall user.ALIYUN

Producer parameters

ParameterRequiredDescriptionDefault
ProducerIdYesGroup ID of the producer, created in the ApsaraMQ for RocketMQ console. For more information, see Terms.N/A
SendMsgTimeoutMillisNoMessage sending timeout in milliseconds.3000
shardingKeyConditionalSharding key for ordered messages. Required when you send ordered messages.N/A

Consumer parameters

ParameterRequiredDescriptionDefault
ConsumerIdYesGroup ID of the consumer, created in the ApsaraMQ for RocketMQ console. For more information, see Terms.N/A
MessageModelNoConsumption model for the consumer instance. Valid values: CLUSTERING -- clustering consumption. BROADCASTING -- broadcasting consumption.CLUSTERING
ConsumeThreadNumsNoNumber of concurrent consumption threads per consumer instance.20

Related topics