Skip to content

Commit c003fc6

Browse files
committed
feat: add amqp binding 0.4.0
1 parent e1ce250 commit c003fc6

File tree

3 files changed

+272
-0
lines changed

3 files changed

+272
-0
lines changed

Diff for: bindings/amqp/0.4.0/channel.json

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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+
}

Diff for: bindings/amqp/0.4.0/message.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://asyncapi.com/bindings/amqp/0.4.0/message.json",
4+
"title": "AMQP message bindings object",
5+
"description": "This object contains information about the message 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+
"contentEncoding": {
15+
"type": "string",
16+
"description": "A MIME encoding for the message content."
17+
},
18+
"messageType": {
19+
"type": "string",
20+
"description": "Application-specific message type."
21+
},
22+
"bindingVersion": {
23+
"type": "string",
24+
"enum": [
25+
"0.4.0"
26+
],
27+
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
28+
}
29+
},
30+
"examples": [
31+
{
32+
"contentEncoding": "gzip",
33+
"messageType": "user.signup",
34+
"bindingVersion": "0.4.0"
35+
}
36+
]
37+
}

Diff for: bindings/amqp/0.4.0/operation.json

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://asyncapi.com/bindings/amqp/0.4.0/operation.json",
4+
"title": "AMQP operation bindings object",
5+
"description": "This object contains information about the operation 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+
"expiration": {
15+
"type": "integer",
16+
"minimum": 0,
17+
"description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero."
18+
},
19+
"userId": {
20+
"type": "string",
21+
"description": "Identifies the user who has sent the message."
22+
},
23+
"cc": {
24+
"type": "array",
25+
"items": {
26+
"type": "string"
27+
},
28+
"description": "The routing keys the message should be routed to at the time of publishing."
29+
},
30+
"priority": {
31+
"type": "integer",
32+
"description": "A priority for the message."
33+
},
34+
"deliveryMode": {
35+
"type": "integer",
36+
"enum": [1,2],
37+
"description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)."
38+
},
39+
"mandatory": {
40+
"type": "boolean",
41+
"description": "Whether the message is mandatory or not."
42+
},
43+
"bcc": {
44+
"type": "array",
45+
"items": {
46+
"type": "string"
47+
},
48+
"description": "Like cc but consumers will not receive this information."
49+
},
50+
"timestamp": {
51+
"type": "boolean",
52+
"description": "Whether the message should include a timestamp or not."
53+
},
54+
"ack": {
55+
"type": "boolean",
56+
"description": "Whether the consumer should ack the message or not."
57+
},
58+
"bindingVersion": {
59+
"type": "string",
60+
"enum": [
61+
"0.4.0"
62+
],
63+
"description": "The version of this binding. If omitted, \"latest\" MUST be assumed."
64+
}
65+
},
66+
"examples": [
67+
{
68+
"expiration": 100000,
69+
"userId": "guest",
70+
"cc": [
71+
"user.logs"
72+
],
73+
"priority": 10,
74+
"deliveryMode": 2,
75+
"mandatory": false,
76+
"bcc": [
77+
"external.audit"
78+
],
79+
"timestamp": true,
80+
"ack": false,
81+
"bindingVersion": "0.4.0"
82+
}
83+
]
84+
}

0 commit comments

Comments
 (0)