Skip to content

Commit ae96600

Browse files
authored
feat: add new kafka topic configuration properties (#481)
1 parent a444ea4 commit ae96600

File tree

4 files changed

+248
-0
lines changed

4 files changed

+248
-0
lines changed

bindings/kafka/0.5.0/channel.json

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json",
4+
"title": "Channel Schema",
5+
"description": "This object contains information about the channel representation in Kafka.",
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+
"topic": {
15+
"type": "string",
16+
"description": "Kafka topic name if different from channel name."
17+
},
18+
"partitions": {
19+
"type": "integer",
20+
"minimum": 1,
21+
"description": "Number of partitions configured on this topic."
22+
},
23+
"replicas": {
24+
"type": "integer",
25+
"minimum": 1,
26+
"description": "Number of replicas configured on this topic."
27+
},
28+
"topicConfiguration" : {
29+
"description": "Topic configuration properties that are relevant for the API.",
30+
"type": "object",
31+
"additionalProperties": true,
32+
"properties": {
33+
"cleanup.policy": {
34+
"description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.",
35+
"type": "array",
36+
"items":{
37+
"type": "string",
38+
"enum": ["compact", "delete"]
39+
}
40+
},
41+
"retention.ms": {
42+
"description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.",
43+
"type": "integer",
44+
"minimum": -1
45+
},
46+
"retention.bytes": {
47+
"description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.",
48+
"type": "integer",
49+
"minimum": -1
50+
},
51+
"delete.retention.ms": {
52+
"description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.",
53+
"type": "integer",
54+
"minimum": 0
55+
},
56+
"max.message.bytes": {
57+
"description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.",
58+
"type": "integer",
59+
"minimum": 0
60+
},
61+
"confluent.key.schema.validation": {
62+
"description": "It shows whether the schema validation for the message key is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-schema-validation)",
63+
"type": "boolean"
64+
},
65+
"confluent.key.subject.name.strategy": {
66+
"description": "The name of the schema lookup strategy for the message key. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-key-subject-name-strategy)",
67+
"type": "string"
68+
},
69+
"confluent.value.schema.validation": {
70+
"description": "It shows whether the schema validation for the message value is enabled. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-schema-validation)",
71+
"type": "boolean"
72+
},
73+
"confluent.value.subject.name.strategy": {
74+
"description": "The name of the schema lookup strategy for the message value. Vendor specific config. For more details: (https://docs.confluent.io/platform/current/installation/configuration/topic-configs.html#confluent-value-subject-name-strategy)",
75+
"type": "string"
76+
}
77+
}
78+
},
79+
"bindingVersion": {
80+
"type": "string",
81+
"enum": [
82+
"0.5.0"
83+
],
84+
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
85+
}
86+
87+
},
88+
"examples": [
89+
{
90+
"topic": "my-specific-topic",
91+
"partitions": 20,
92+
"replicas": 3,
93+
"bindingVersion": "0.5.0"
94+
}
95+
]
96+
}

bindings/kafka/0.5.0/message.json

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://asyncapi.com/bindings/kafka/0.5.0/message.json",
4+
"title": "Message Schema",
5+
"type": "object",
6+
"additionalProperties": false,
7+
"patternProperties": {
8+
"^x-[\\w\\d\\.\\x2d_]+$": {
9+
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
10+
}
11+
},
12+
"properties": {
13+
"key": {
14+
"oneOf": [
15+
{
16+
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
17+
},
18+
{
19+
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"
20+
}
21+
],
22+
"description": "The message key."
23+
},
24+
"schemaIdLocation": {
25+
"type": "string",
26+
"description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.",
27+
"enum": ["header", "payload"]
28+
},
29+
"schemaIdPayloadEncoding": {
30+
"type": "string",
31+
"description": "Number of bytes or vendor specific values when schema id is encoded in payload."
32+
},
33+
"schemaLookupStrategy": {
34+
"type": "string",
35+
"description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."
36+
},
37+
"bindingVersion": {
38+
"type": "string",
39+
"enum": [
40+
"0.5.0"
41+
],
42+
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
43+
}
44+
45+
},
46+
"examples": [
47+
{
48+
"key": {
49+
"type": "string",
50+
"enum": [
51+
"myKey"
52+
]
53+
},
54+
"schemaIdLocation": "payload",
55+
"schemaIdPayloadEncoding": "apicurio-new",
56+
"schemaLookupStrategy": "TopicIdStrategy",
57+
"bindingVersion": "0.5.0"
58+
},
59+
{
60+
"key": {
61+
"$ref": "path/to/user-create.avsc#/UserCreate"
62+
},
63+
"schemaIdLocation": "payload",
64+
"schemaIdPayloadEncoding": "4",
65+
"bindingVersion": "0.5.0"
66+
}
67+
]
68+
}

bindings/kafka/0.5.0/operation.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "http://asyncapi.com/bindings/kafka/0.5.0/operation.json",
4+
"title": "Operation Schema",
5+
"description": "This object contains information about the operation representation in Kafka.",
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+
"groupId": {
15+
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
16+
"description": "Id of the consumer group."
17+
},
18+
"clientId": {
19+
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json",
20+
"description": "Id of the consumer inside a consumer group."
21+
},
22+
"bindingVersion": {
23+
"type": "string",
24+
"enum": [
25+
"0.5.0"
26+
],
27+
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
28+
}
29+
},
30+
"examples": [
31+
{
32+
"groupId": {
33+
"type": "string",
34+
"enum": [
35+
"myGroupId"
36+
]
37+
},
38+
"clientId": {
39+
"type": "string",
40+
"enum": [
41+
"myClientId"
42+
]
43+
},
44+
"bindingVersion": "0.5.0"
45+
}
46+
]
47+
}

bindings/kafka/0.5.0/server.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/kafka/0.5.0/server.json",
4+
"title": "Server Schema",
5+
"description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.",
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+
"schemaRegistryUrl": {
15+
"type": "string",
16+
"description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."
17+
},
18+
"schemaRegistryVendor": {
19+
"type": "string",
20+
"description": "The vendor of the Schema Registry and Kafka serdes library that should be used."
21+
},
22+
"bindingVersion": {
23+
"type": "string",
24+
"enum": [
25+
"0.5.0"
26+
],
27+
"description": "The version of this binding."
28+
}
29+
},
30+
"examples": [
31+
{
32+
"schemaRegistryUrl": "https://my-schema-registry.com",
33+
"schemaRegistryVendor": "confluent",
34+
"bindingVersion": "0.5.0"
35+
}
36+
]
37+
}

0 commit comments

Comments
 (0)