Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt Kafka bindings to v3 #446

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
GITHUB_LOGIN: asyncapi-bot
MERGE_LABELS: ""
MERGE_LABELS: "!do-not-merge"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
MERGE_RETRIES: "20"
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ test
go.mod
go.sum
*.go
tools/bundler
81 changes: 81 additions & 0 deletions bindings/kafka/v2-0.4.0/channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/v2-0.4.0/channel.json",
"title": "Channel Schema",
"description": "This object contains information about the channel representation in Kafka.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"topic": {
"type": "string",
"description": "Kafka topic name if different from channel name."
},
"partitions": {
"type": "integer",
"minimum": 1,
"description": "Number of partitions configured on this topic."
},
"replicas": {
"type": "integer",
"minimum": 1,
"description": "Number of replicas configured on this topic."
},
"topicConfiguration" : {
"description": "Topic configuration properties that are relevant for the API.",
"type": "object",
"additionalProperties": false,
"properties": {
"cleanup.policy": {
"description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.",
"type": "array",
"items":{
"type": "string",
"enum": ["compact", "delete"]
}
},
"retention.ms": {
"description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.",
"type": "integer",
"minimum": -1
},
"retention.bytes": {
"description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.",
"type": "integer",
"minimum": -1
},
"delete.retention.ms": {
"description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.",
"type": "integer",
"minimum": 0
},
"max.message.bytes": {
"description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.",
"type": "integer",
"minimum": 0
}
}
},
"bindingVersion": {
"type": "string",
"enum": [
"v2-0.4.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"examples": [
{
"topic": "my-specific-topic",
"partitions": 20,
"replicas": 3,
"bindingVersion": "v2-0.4.0"
}
]
}

68 changes: 68 additions & 0 deletions bindings/kafka/v2-0.4.0/message.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/message.json",
"title": "Message Schema",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://asyncapi.com/definitions/2.4.0/specificationExtension.json"
}
},
"properties": {
"key": {
"oneOf": [
{
"$ref": "https://asyncapi.com/definitions/2.4.0/schema.json"
},
{
"$ref": "https://asyncapi.com/definitions/2.4.0/Reference.json"
}
],
"description": "The message key."
},
"schemaIdLocation": {
"type": "string",
"description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.",
"enum": ["header", "payload"]
},
"schemaIdPayloadEncoding": {
"type": "string",
"description": "Number of bytes or vendor specific values when schema id is encoded in payload."
},
"schemaLookupStrategy": {
"type": "string",
"description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.4.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"examples": [
{
"key": {
"type": "string",
"enum": [
"myKey"
]
},
"schemaIdLocation": "payload",
"schemaIdPayloadEncoding": "apicurio-new",
"schemaLookupStrategy": "TopicIdStrategy",
"bindingVersion": "0.3.0"
},
{
"key": {
"$ref": "path/to/user-create.avsc#/UserCreate"
},
"schemaIdLocation": "payload",
"schemaIdPayloadEncoding": "4",
"bindingVersion": "0.3.0"
}
]
}
48 changes: 48 additions & 0 deletions bindings/kafka/v2-0.4.0/operation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/operation.json",
"title": "Operation Schema",
"description": "This object contains information about the operation representation in Kafka.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"groupId": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/schema",
"description": "Id of the consumer group."
},
"clientId": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/schema",
"description": "Id of the consumer inside a consumer group."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.4.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"examples": [
{
"groupId": {
"type": "string",
"enum": [
"myGroupId"
]
},
"clientId": {
"type": "string",
"enum": [
"myClientId"
]
},
"bindingVersion": "0.3.0"
}
]
}
37 changes: 37 additions & 0 deletions bindings/kafka/v2-0.4.0/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/server.json",
"title": "Server Schema",
"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.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\-\\_]+$": {
"$ref": "https://raw.githubusercontent.com/asyncapi/spec-json-schemas/v2.14.0/schemas/2.4.0.json#/definitions/specificationExtension"
}
},
"properties": {
"schemaRegistryUrl": {
"type": "string",
"description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)."
},
"schemaRegistryVendor": {
"type": "string",
"description": "The vendor of the Schema Registry and Kafka serdes library that should be used."
},
"bindingVersion": {
"type": "string",
"enum": [
"0.4.0"
],
"description": "The version of this binding."
}
},
"examples": [
{
"schemaRegistryUrl": "https://my-schema-registry.com",
"schemaRegistryVendor": "confluent",
"bindingVersion": "0.3.0"
}
]
}
80 changes: 80 additions & 0 deletions bindings/kafka/v3-0.4.0/channel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://asyncapi.com/bindings/kafka/v3-0.4.0/channel.json",
"title": "Channel Schema",
"description": "This object contains information about the channel representation in Kafka.",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-[\\w\\d\\.\\x2d_]+$": {
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json"
}
},
"properties": {
"topic": {
"type": "string",
"description": "Kafka topic name if different from channel name."
},
"partitions": {
"type": "integer",
"minimum": 1,
"description": "Number of partitions configured on this topic."
},
"replicas": {
"type": "integer",
"minimum": 1,
"description": "Number of replicas configured on this topic."
},
"topicConfiguration" : {
"description": "Topic configuration properties that are relevant for the API.",
"type": "object",
"additionalProperties": false,
"properties": {
"cleanup.policy": {
"description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.",
"type": "array",
"items":{
"type": "string",
"enum": ["compact", "delete"]
}
},
"retention.ms": {
"description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.",
"type": "integer",
"minimum": -1
},
"retention.bytes": {
"description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.",
"type": "integer",
"minimum": -1
},
"delete.retention.ms": {
"description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.",
"type": "integer",
"minimum": 0
},
"max.message.bytes": {
"description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.",
"type": "integer",
"minimum": 0
}
}
},
"bindingVersion": {
"type": "string",
"enum": [
"v3-0.4.0"
],
"description": "The version of this binding. If omitted, 'latest' MUST be assumed."
}

},
"examples": [
{
"topic": "my-specific-topic",
"partitions": 20,
"replicas": 3,
"bindingVersion": "v3-0.4.0"
}
]
}
Loading
Loading