Updated on 2025-12-18 GMT+08:00

Sending a Message

Function

This API is used to send a message.

URI

POST /v2/{engine}/{project_id}/instances/{instance_id}/messages

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

engine

Yes

String

Definition

Engine.

Constraints

N/A

Range

  • rocketmq: RocketMQ message engine.

  • reliability: RocketMQ message engine alias.

Default Value

N/A

project_id

Yes

String

Definition

Project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID. You can call the API for querying all instances to obtain the instance ID. The instance ID is in the response body.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

topic

Yes

String

Definition

Topic name.

Constraints

N/A

Range

N/A

Default Value

N/A

body

Yes

String

Definition

Message content.

Constraints

N/A

Range

N/A

Default Value

N/A

property_list

No

Array of SendMessageProperties objects

Definition

Feature list.

Table 3 SendMessageProperties

Parameter

Mandatory

Type

Description

name

No

String

Definition:

Feature name.

Range:

N/A

value

No

String

Definition:

Feature value.

Range:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

topic

String

Definition:

Topic name.

Range:

N/A

body

String

Definition:

Message content.

Range:

N/A

property_list

Array of SendMessageProperties objects

Definition:

Feature list.

Range:

N/A

msg_id

String

Definition:

Message ID.

Range:

N/A

queue_id

Number

Definition:

Queue ID.

Range:

N/A

queue_offset

Number

Definition:

Queue offset.

Range:

N/A

broker_name

String

Definition:

Broker name.

Range:

N/A

Table 5 SendMessageProperties

Parameter

Type

Description

name

String

Definition:

Feature name.

Range:

N/A

value

String

Definition:

Feature value.

Range:

N/A

Example Requests

Sending a message

POST https://{endpoint}/v2/{engine}/{project_id}/instances/{instance_id}/messages

Example Responses

Status code: 200

Successful

{
  "topic" : "aaaaaaaaaaaa",
  "body" : "test",
  "property_list" : [ ],
  "msg_id" : "644F0E2A315323EAB33D8F4733110009",
  "queue_id" : 0,
  "queue_offset" : 0,
  "broker_name" : "broker-0"
}

Status Codes

Status Code

Description

200

Successful

Error Codes

See Error Codes.