ApsaraMQ for RocketMQ provides the C/C++ SDK to send and consume messages. This topic describes the parameters for sending and consuming messages.
| Parameter | Description |
|---|---|
| NAMESRV_ADDR | The TCP endpoint, which can be obtained from the Instances page in the ApsaraMQ for RocketMQ console. |
| AccessKey | An AccessKey ID is used as the identifier for identity authentication. For information about how to obtain an AccessKey ID, see Create an AccessKey pair. |
| SecretKey | An AccessKey secret is used as the password for identity authentication. For information about how to obtain an AccessKey secret, see Create an AccessKey pair. |
| OnsChannel | The user channel, which is ALIYUN by default and CLOUD for CloudTmall users. |
Parameters for sending messages
| Parameter | Description |
|---|---|
| ProducerId | The group ID that you created in the ApsaraMQ for RocketMQ console. For more information, see Terms. |
| SendMsgTimeoutMillis | The message transmission timeout period in milliseconds. Default value: 3000. |
| shardingKey (for ordered messages) | The sharding key for ordered messages. |
Parameter for consuming messages
| Parameter | Description |
|---|---|
| ConsumerId | The group ID that you created in the ApsaraMQ for RocketMQ console. For more information, see Terms |
| MessageModel | The message consumption model of a consumer instance. Valid values are as follows:
|
| ConsumeThreadNums | The number of consumption threads for a consumer instance. Default value: 20. |