Skip to content

Commit

Permalink
Merge pull request #672 from ctasada/ctasada/asyncapi-kafka-050
Browse files Browse the repository at this point in the history
(chore) Updated AsyncAPI Kafka binding to version 0.5.0
  • Loading branch information
ctasada authored Apr 1, 2024
2 parents 708617a + 6bbc626 commit e9b197c
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ public class KafkaChannelBinding extends ChannelBinding {
*/
@Builder.Default
@JsonProperty("bindingVersion")
private String bindingVersion = "0.4.0";
private String bindingVersion = "0.5.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,28 @@ public class KafkaChannelTopicConfiguration {
@PositiveOrZero
@JsonProperty("max.message.bytes")
private Integer maxMessageBytes;

/**
* It shows whether the schema validation for the message key is enabled. Vendor specific config.
*/
@JsonProperty("confluent.key.schema.validation")
private Boolean confluentKeySchemaValidation;

/**
* The name of the schema lookup strategy for the message key. Vendor specific config.
*/
@JsonProperty("confluent.key.subject.name.strategy")
private String confluentKeySubjectNameStrategy;

/**
* It shows whether the schema validation for the message value is enabled. Vendor specific config.
*/
@JsonProperty("confluent.value.schema.validation")
private Boolean confluentValueSchemaValidation;

/**
* The name of the schema lookup strategy for the message value. Vendor specific config.
*/
@JsonProperty("confluent.value.subject.name.strategy")
private String confluentValueSubjectNameStrategy;
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ public class KafkaMessageBinding extends MessageBinding {
*/
@Builder.Default
@JsonProperty("bindingVersion")
private String bindingVersion = "0.4.0";
private String bindingVersion = "0.5.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ public class KafkaOperationBinding extends OperationBinding {
*/
@Builder.Default
@JsonProperty("bindingVersion")
private String bindingVersion = "0.4.0";
private String bindingVersion = "0.5.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ public class KafkaServerBinding extends ServerBinding {
*/
@Builder.Default
@JsonProperty("bindingVersion")
private String bindingVersion = "0.4.0";
private String bindingVersion = "0.5.0";
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ void shouldSerializeKafkaTopic() throws IOException {
.retentionBytes(1000000000)
.deleteRetentionMs(86400000)
.maxMessageBytes(1048588)
.confluentKeySchemaValidation(true)
.confluentKeySubjectNameStrategy("TopicNameStrategy")
.confluentValueSchemaValidation(true)
.confluentValueSubjectNameStrategy("TopicNameStrategy")
.build());

// Uses https://github.com/asyncapi/bindings/blob/master/amqp/README.md#example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"key": {
"type": "string"
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
}
Expand All @@ -86,7 +86,7 @@
"myGroupId"
]
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ components:
kafka:
key:
type: string
bindingVersion: 0.4.0
bindingVersion: 0.5.0
operations:
new-user_listenerMethod_subscribe:
action: send
Expand All @@ -58,6 +58,6 @@ operations:
type: string
enum:
- myGroupId
bindingVersion: 0.4.0
bindingVersion: 0.5.0
messages:
- "$ref": "#/channels/new-user/messages/io.github.springwolf.core.ExamplePayload"
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ channels:
retention.bytes: 1000000000
delete.retention.ms: 86400000
max.message.bytes: 1048588
bindingVersion: '0.4.0'
bindingVersion: '0.5.0'
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ channels:
schemaIdLocation: 'payload'
schemaIdPayloadEncoding: 'apicurio-new'
schemaLookupStrategy: 'TopicIdStrategy'
bindingVersion: '0.4.0'
bindingVersion: '0.5.0'
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ operations:
clientId:
type: string
enum: ['myClientId']
bindingVersion: '0.4.0'
bindingVersion: '0.5.0'
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ servers:
kafka:
schemaRegistryUrl: 'https://my-schema-registry.com'
schemaRegistryVendor: 'confluent'
bindingVersion: '0.4.0'
bindingVersion: '0.5.0'
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ topicConfiguration:
retention.ms: 604800000
retention.bytes: 1000000000
delete.retention.ms: 86400000
max.message.bytes: 1048588
max.message.bytes: 1048588
confluent.key.schema.validation: true
confluent.key.subject.name.strategy: "TopicNameStrategy"
confluent.value.schema.validation: true
confluent.value.subject.name.strategy: "TopicNameStrategy"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@EmbeddedKafka(partitions = 1)
@DirtiesContext
public class ApiIntegrationTest {
class ApiIntegrationTest {

@Autowired
private TestRestTemplate restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -49,7 +49,7 @@
},
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -74,7 +74,7 @@
},
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand Down Expand Up @@ -1092,7 +1092,7 @@
"title": "StringEnvelope",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1110,7 +1110,7 @@
"title": "AnotherPayloadAvroDto",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1128,7 +1128,7 @@
"title": "Message",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1146,7 +1146,7 @@
"title": "AnotherPayloadDto",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1164,7 +1164,7 @@
"title": "ExamplePayloadDto",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1190,7 +1190,7 @@
"example-key"
]
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1209,7 +1209,7 @@
"title": "XmlPayloadDto",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1228,7 +1228,7 @@
"title": "YamlPayloadDto",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1246,7 +1246,7 @@
"title": "String",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
},
Expand All @@ -1271,7 +1271,7 @@
"example-key"
]
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
}
}
Expand All @@ -1291,7 +1291,7 @@
"example-group-id"
]
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1309,7 +1309,7 @@
"description": "Requires a running kafka-schema-registry. See docker-compose.yml to start it",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1325,7 +1325,7 @@
},
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1341,7 +1341,7 @@
},
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand Down Expand Up @@ -1377,7 +1377,7 @@
"foo-clientId"
]
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1393,7 +1393,7 @@
},
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1411,7 +1411,7 @@
"description": "Final classes (like String) can be documented using an envelope class and the @AsyncApiPayload annotation.",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1438,7 +1438,7 @@
"foo-clientId"
]
},
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1456,7 +1456,7 @@
"description": "Showcases a xml based message",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand All @@ -1474,7 +1474,7 @@
"description": "Showcases a yaml based message",
"bindings": {
"kafka": {
"bindingVersion": "0.4.0"
"bindingVersion": "0.5.0"
}
},
"messages": [
Expand Down
Loading

0 comments on commit e9b197c

Please sign in to comment.