All Products
Search
Document Center

ApsaraMQ for RocketMQ:GetMessageDetail

Last Updated:Dec 19, 2025

Retrieves the details of a specific message.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rocketmq:GetMessageDetail

get

*Topic

acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}/topic/{#TopicName}

None None

Request syntax

GET /instances/{instanceId}/topics/{topicName}/messages/{messageId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The ID of the instance.

rmq-cn-lbj31fs790d

topicName

string

Yes

The name of the topic.

flink_test

messageId

string

Yes

The ID of the message.

0A792FDB001F7591083D30ADB1DA11D5

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

Result

requestId

string

The ID of the request.

FAEBD71F-E839-52F9-BD7B-8F1290525841

success

boolean

Indicates whether the request was successful.

true

data

object

The data that is returned.

regionId

string

The ID of the region.

cn-hangzhou

instanceId

string

The ID of the instance.

rmq-cn-7e22ody****

topicName

string

The name of the topic.

topic_test

messageId

string

The ID of the message.

01BE87E485F0C7808C04543CAF00000001

bornTime

string

The time when the message was generated.

2023-03-22 12:17:08

storeTime

string

The time when the message was stored.

2023-03-22 12:17:08

body

string

The body of the message.

{}

bodySize

integer

The size of the message body.

123

bornHost

string

The host that generated the message.

xxx.xx.xxx.xx

storeHost

string

The host that stored the message.

xxx.xx.xxx.xx

messageType

string

The type of the message.

NORMAL

messageTag

string

The tags of the message.

xx

messageGroup

string

The sharding key. This parameter is returned only for ordered messages.

xx

messageKeys

array

The business keys of the message.

string

A business key.

xx

userProperties

object

The user-defined properties of the message.

string

A user-defined property.

xxx

systemProperties

object

The default system properties of the message.

string

A default system property.

xx

liteTopicName

string

The name of the lightweight topic.

abc

code

string

The error code.

Topic.NotFound

message

string

The error message.

Parameter instanceId is mandatory for this action .

httpStatusCode

integer

The HTTP status code.

200

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

Examples

Success response

JSON format

{
  "requestId": "FAEBD71F-E839-52F9-BD7B-8F1290525841",
  "success": true,
  "data": {
    "regionId": "cn-hangzhou",
    "instanceId": "rmq-cn-7e22ody****",
    "topicName": "topic_test",
    "messageId": "01BE87E485F0C7808C04543CAF00000001",
    "bornTime": "2023-03-22 12:17:08",
    "storeTime": "2023-03-22 12:17:08",
    "body": "{}",
    "bodySize": 123,
    "bornHost": "xxx.xx.xxx.xx",
    "storeHost": "xxx.xx.xxx.xx",
    "messageType": "NORMAL",
    "messageTag": "xx",
    "messageGroup": "xx",
    "messageKeys": [
      "xx"
    ],
    "userProperties": {
      "key": "xxx"
    },
    "systemProperties": {
      "key": "xx"
    },
    "liteTopicName": "abc"
  },
  "code": "Topic.NotFound",
  "message": "Parameter instanceId is mandatory for this action .",
  "httpStatusCode": 200,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.