https://cmq-topic-{$region}.api.qcloud.com
http://cmq-topic-{$region}.api.tencentyun.com
Parameter name | Required | Type | Description |
TopicName | Yes | String | Topic's name is unique under the same account in a single region. The name of topic is a string of no more than 64 characters, which must begin with a letter, and the rest can contain letters, numbers and underscores (-). |
MsgBody.n | Yes | String | Message body. Represents a message in this batch. Currently, the number of messages in batch cannot exceed 16. For the convenience of users, n can start with 0 or 1, but it must be continuous, such as sending two messages, which can be (msgBody.0, msgBody.1) or (msgBody.1, msgBody.2). Note: since the total size of all messages (excluding headers and other parameters, only msgBody) is limited to 64k, it is recommended to plan the number of batches to be sent in advance. |
MsgTag.n | No | String | Message filter tag. Message label (for message filtering). The number of tags cannot exceed 5, and each label cannot exceed 16 characters. and Subscribe The filterTag parameter of the API is used together. Rules: (1) if filterTag is not set, subscriptions receive all messages from publish to Topic regardless of whether msgTag is set or not. (2) if the filterTag array has a value, the subscription will receive the message from publish to Topic only if at least one value in the array also exists in the msgTag array (that is, there is an intersection between filterTag and msgTag). (3) if the filterTag array has a value, but msgTag is not set, then no messages from publish to Topic will be received, which can be regarded as a special case of (2). In this case, filterTag and msgTag do not intersect. The overall design idea of the rules is based on the wishes of the subscribers. |
RoutingKey | No | String | Length < = 64 bytes, this field is used to indicate the routing path to send the message, with a maximum of 15 ".", that is, a maximum of 16 phrases. When a message is sent to a exchange of type topic, it is not optional to specify that the routingKey, needs to meet the above format requirements. A message with routingKey specified by the subscriber will be pushed to all consumers with which the BindingKey can match, which is related in two ways: 1 * (asterisk): can replace a word (a continuous string of letters); 2 # (pound sign): can match one or more characters. |
Parameter name | Type | Description |
Code | Int | |
Message | String | Error message. |
RequestId | String | When an internal server error occurs in the request ID, generated by the server, the user can submit this ID to Backend Background to locate the problem. |
MsgList | Array | The server generates a unique identification ID list of messages, and each element is the information of a message. |
Parameter name | Type | Description |
MsgId | String | The server generates a unique identity ID for the message. |
https://domain/v2/index.php?Action=BatchPublishMessage&topicName=test-topic-123&msgBody.1=helloworld1&msgBody.2=helloworld2&<Common request parameters>
{"code" : 0,"message" : "","requestId":"14534664555","msgList":[{"msgId":"123345346"},{"msgId":"456436346"}]}