Retransmitting a Message
Function
This API is used to retransmit a message.
URI
POST /v2/{project_id}/mqs/instances/{instance_id}/messages/action
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain a project ID, see "Appendix" > "Obtaining a Project ID" in this document. |
| instance_id | Yes | String | Instance ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| action_id | Yes | String | Retransmission type. Currently, only resend is supported. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token, which can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| topic | Yes | String | Topic name. |
| partition | Yes | Integer | Partition. |
| message_offset | Yes | Number | Message offset. |
| consumer_key | No | String | Application key. Add consumer_key to the message header. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| topic | String | Topic name. |
| partition | Integer | Partition. |
| message_offset | Integer | Message offset. |
| consumer_key | String | Application key. Add consumer_key to the message header. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Requests
Retransmit the message whose offset is 4 and add a specified header to it.
POST https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/messages/action?action_id=resend
{
"topic" : "topic-test",
"partition" : 0,
"message_offset" : 4,
"consumer_key" : "keyA"
} Example Responses
Status code: 200
OK
{
"topic" : "topic-test",
"partition" : 0,
"message_offset" : 4,
"consumer_key" : "keyA"
} Status code: 400
Bad Request
{
"error_code" : 400,
"error_msg" : "Bad Request"
} Status code: 403
Forbidden
{
"error_code" : 403,
"error_msg" : "Forbidden"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 403 | Forbidden |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.