|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "http://asyncapi.com/bindings/amqp/0.4.0/channel.json", |
| 4 | + "title": "AMQP channel bindings object", |
| 5 | + "description": "This object contains information about the channel representation in AMQP.", |
| 6 | + "type": "object", |
| 7 | + "additionalProperties": false, |
| 8 | + "patternProperties": { |
| 9 | + "^x-[\\w\\d\\.\\x2d_]+$": { |
| 10 | + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" |
| 11 | + } |
| 12 | + }, |
| 13 | + "properties": { |
| 14 | + "is": { |
| 15 | + "type": "string", |
| 16 | + "enum": ["queue", "routingKey"], |
| 17 | + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." |
| 18 | + }, |
| 19 | + "name": { |
| 20 | + "type": "string", |
| 21 | + "maxLength": 255, |
| 22 | + "description": "When is=routingKey, this defines the actual routing pattern to route the message from the exchange to the queue." |
| 23 | + }, |
| 24 | + "channel": { |
| 25 | + "type": "object", |
| 26 | + "properties": { |
| 27 | + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" |
| 28 | + } |
| 29 | + }, |
| 30 | + "exchange": { |
| 31 | + "type": "object", |
| 32 | + "properties": { |
| 33 | + "name": { |
| 34 | + "type": "string", |
| 35 | + "maxLength": 255, |
| 36 | + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." |
| 37 | + }, |
| 38 | + "type": { |
| 39 | + "type": "string", |
| 40 | + "enum": ["topic", "direct", "fanout", "default", "headers"], |
| 41 | + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." |
| 42 | + }, |
| 43 | + "durable": { |
| 44 | + "type": "boolean", |
| 45 | + "description": "Whether the exchange should survive broker restarts or not." |
| 46 | + }, |
| 47 | + "autoDelete": { |
| 48 | + "type": "boolean", |
| 49 | + "description": "Whether the exchange should be deleted when the last queue is unbound from it." |
| 50 | + }, |
| 51 | + "vhost": { |
| 52 | + "type": "string", |
| 53 | + "default": "/", |
| 54 | + "description": "The virtual host of the exchange. Defaults to '/'." |
| 55 | + } |
| 56 | + }, |
| 57 | + "description": "When is=routingKey, this object defines the exchange properties." |
| 58 | + }, |
| 59 | + "queue": { |
| 60 | + "type": "object", |
| 61 | + "properties": { |
| 62 | + "name": { |
| 63 | + "type": "string", |
| 64 | + "maxLength": 255, |
| 65 | + "description": "The name of the queue. It MUST NOT exceed 255 characters long." |
| 66 | + }, |
| 67 | + "durable": { |
| 68 | + "type": "boolean", |
| 69 | + "description": "Whether the queue should survive broker restarts or not." |
| 70 | + }, |
| 71 | + "exclusive": { |
| 72 | + "type": "boolean", |
| 73 | + "description": "Whether the queue should be used only by one connection or not." |
| 74 | + }, |
| 75 | + "autoDelete": { |
| 76 | + "type": "boolean", |
| 77 | + "description": "Whether the queue should be deleted when the last consumer unsubscribes." |
| 78 | + }, |
| 79 | + "vhost": { |
| 80 | + "type": "string", |
| 81 | + "default": "/", |
| 82 | + "description": "The virtual host of the queue. Defaults to '/'." |
| 83 | + } |
| 84 | + }, |
| 85 | + "description": "When is=queue, this object defines the queue properties." |
| 86 | + }, |
| 87 | + "bindingVersion": { |
| 88 | + "type": "string", |
| 89 | + "enum": [ |
| 90 | + "0.4.0" |
| 91 | + ], |
| 92 | + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." |
| 93 | + } |
| 94 | + }, |
| 95 | + "oneOf": [ |
| 96 | + { |
| 97 | + "properties": { |
| 98 | + "is": { "const": "routingKey" } |
| 99 | + }, |
| 100 | + "required": [ |
| 101 | + "exchange" |
| 102 | + ], |
| 103 | + "not": { |
| 104 | + "required": [ |
| 105 | + "queue" |
| 106 | + ] |
| 107 | + } |
| 108 | + }, |
| 109 | + { |
| 110 | + "properties": { |
| 111 | + "is": { "const": "queue" } |
| 112 | + }, |
| 113 | + "required": [ |
| 114 | + "queue" |
| 115 | + ], |
| 116 | + "not": { |
| 117 | + "required": [ |
| 118 | + "exchange" |
| 119 | + ] |
| 120 | + } |
| 121 | + } |
| 122 | + ], |
| 123 | + "examples": [ |
| 124 | + { |
| 125 | + "is": "routingKey", |
| 126 | + "name": "routing.pattern", |
| 127 | + "channel": { |
| 128 | + "$ref": "#/components/channels/my-queue-name" |
| 129 | + }, |
| 130 | + "exchange": { |
| 131 | + "name": "myExchange", |
| 132 | + "type": "topic", |
| 133 | + "durable": true, |
| 134 | + "autoDelete": false, |
| 135 | + "vhost": "/" |
| 136 | + }, |
| 137 | + "bindingVersion": "0.4.0" |
| 138 | + }, |
| 139 | + { |
| 140 | + "is": "queue", |
| 141 | + "queue": { |
| 142 | + "name": "my-queue-name", |
| 143 | + "durable": true, |
| 144 | + "exclusive": true, |
| 145 | + "autoDelete": false, |
| 146 | + "vhost": "/" |
| 147 | + }, |
| 148 | + "bindingVersion": "0.4.0" |
| 149 | + } |
| 150 | + ] |
| 151 | +} |
0 commit comments