Creates a binding.

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 test

The x-match attribute. Valid values:

  • all: A headers exchange routes a message to a queue only if all binding attributes of the queue except for x-match match the headers attributes of the message. This value is a default value.
  • any: A headers exchange routes a message to a queue if one or more binding attributes of the queue except for x-match match the headers attributes of the message.

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.

  • For a non-topic source exchange:
    • The binding key can contain only letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
    • The binding key must be 1 to 255 characters in length.
  • For a topic source exchange:
    • The binding key can contain letters, digits, hyphens (-), underscores (_), periods (.), and at signs (@).
    • If the binding key contains a number sign (#), the binding key must start with a number sign (#) followed by a period (.) or end with a number sign (#) that follows a period (.).
    • The binding key must be 1 to 255 characters in length.
BindingType String Yes QUEUE

The type of the destination. Valid values:

  • QUEUE
  • EXCHANGE
DestinationName String Yes DemoQueue

The name of the destination.

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.

VirtualHost String Yes test

The name of the vhost.

Response parameters

Parameter Type Example Description
RequestId String 09768C14-E51C-4F4A-8077-30810032C***

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateBinding
&Argument=test
&BindingKey=.test
&BindingType=QUEUE
&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.