Creates a binding to bind a queue or an exchange to a specified exchange.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateBinding | The operation that you want to perform. Set the value to CreateBinding. |
Argument | String | Yes | x-match:all;type:report;format:pdf | The key-value pairs that are configured for the headers attributes of a message. One or more key-value pairs can be concatenated to configure the headers attributes of a message. The x-match attribute must be set to one of the following valid values. Other attributes can be customized. Valid values of the x-match attribute:
Separate the attributes with semicolons (;), and separate the key and value of an attribute with a colon (:). An example is x-match:all;type:report;format:pdf. This parameter applies only to headers exchanges. You can set this parameter to an arbitrary value for other types of exchanges. |
BindingKey | String | Yes | .test | The binding key.
|
BindingType | String | Yes | 0 | The type of the object that you want to bind to the source exchange. Valid values:
|
DestinationName | String | Yes | DemoQueue | The name of the object that you want to bind to the source exchange. The object must be created in the console. |
InstanceId | String | Yes | amqp-cn-v0h1kb9nu*** | The ID of the instance. |
RegionId | String | Yes | cn-hangzhou | The ID of the region. |
SourceExchange | String | Yes | NormalEX | The name of the source exchange. The source exchange must be created in the console. |
VirtualHost | String | Yes | test | The name of the vhost. The vhost must be created in the console. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 09768C14-E51C-4F4A-8077-30810032C*** | The ID of the request. |
Examples
Sample requests
http(s)://amqp-open.cn-hangzhou.aliyuncs.com/?Action=CreateBinding
&Argument=x-match:all;type:report;format:pdf
&BindingKey=.test
&BindingType=0
&DestinationName=DemoQueue
&InstanceId=amqp-cn-v0h1kb9nu***
&RegionId=cn-hangzhou
&SourceExchange=NormalEX
&VirtualHost=test
&<Common request parameters>
Sample success responses
XML
format
<CreateBindingResponse>
<RequestId>09768C14-E51C-4F4A-8077-30810032C***</RequestId>
</CreateBindingResponse>
JSON
format
{
"RequestId":"09768C14-E51C-4F4A-8077-30810032C***"
}
Error codes
For a list of error codes, visit the API Error Center.