Distributed Message Service RabbitMQ

Create an Exchange

2024-06-27 06:49:42

Interface Protocol

Interface

https://[endpoint].ctapi.ctyun.cn/v1/exchange/create

Request Method

POST

Request Parameters

Required or Not

Parameter Type

Description

prodInstId

Yes

String

Instance ID

vhost

Yes

String

vhost name

name

Yes

String

Queue Name

type

No

Single choice (direct, topic, fanout, headers,   x-delayed-message)

Select the node where the data is stored

x-delayed-type

Required when type is x-delayed-message

Single choice (direct, topic, fanout, headers)

Exchange type for delay queue

durable

No

Boolean

Persistence or Not

auto_delete

No

Boolean

Whether to delete automatically

internal

No

Boolean

Select the node where the data is stored

arguments

No

String

For other arguments, please refer to the following table,   format: {x-message-ttl: 123, x-overflow: "reject-publish",   x-queue-mode: "lazy",…}

Response Parameter

Parameter Type

Description

statusCode

String

The status code of the interface on the system layer.   Success: 800; failure: 900.

message

String

Status Description

returnObj

String

Return the object. The parameters included in this   parameter are described in the comments in Response Examples.

Arguments Description

Parameter Name

Parameter Type

Description

alternate-exchange

String

Alternate exchange

Sample Request

`PUT https://[endpoint].ctapi.ctyun.cn/v1/exchange/create`

Return Example

(1) Example of successful response

{

    "returnObj": {"data": null },

    "message": "success",

    "statusCode": "800"

}

(2) Example of failed response

{

    "returnObj": {"data": "{\"error\":\"not_found\",\"reason\":\"vhost_not_found\"}"},

    "message": "...",

    "statusCode": "900"

}


h.50v.3d4L5D