Skip to content
Open
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
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.commercehub.gradle.plugin.avro' version '0.99.99'
id 'com.github.davidmc24.gradle.plugin.avro' version '1.5.0'
id 'java'
id 'java-library'
id 'maven'
Expand All @@ -15,16 +15,16 @@ repositories {
}

dependencies {
implementation 'io.confluent:kafka-avro-serializer:5.5.3'
implementation 'org.apache.avro:avro:1.10.2'
implementation 'io.cloudevents:cloudevents-kafka:2.0.0'
implementation 'io.confluent:kafka-avro-serializer:7.2.1'
implementation 'org.apache.avro:avro:1.11.1'
implementation 'io.cloudevents:cloudevents-kafka:2.4.0'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
testImplementation 'org.apache.kafka:kafka_2.12:2.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
testImplementation 'org.apache.kafka:kafka_2.12:3.2.3'

compileOnly 'org.projectlombok:lombok:1.18.18'
annotationProcessor 'org.projectlombok:lombok:1.18.16'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
}

group = 'io.github.kattlo'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Map;
import java.util.Objects;

import io.confluent.kafka.schemaregistry.avro.AvroSchema;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.header.Headers;

Expand Down Expand Up @@ -70,7 +71,7 @@ public void configure(Map<String, ?> configs, boolean isKey) {
configs.get(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG);

log.debug("{}={}", KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG,
schemaRegistryUrl);;
schemaRegistryUrl);

} else {
throw new IllegalArgumentException(CloudEventSerializer.ENCODING_CONFIG + "=" + encoding + " not supported");
Expand Down Expand Up @@ -109,8 +110,7 @@ public byte[] serialize(String topic, Headers headers, Object event) {

// get the versionId of registered schema
try {
var versions = super.schemaRegistry.getAllVersions(subjectName);
var version = versions.get(versions.size() -1);
var version = super.schemaRegistry.getVersion(subjectName, new AvroSchema(value.getSchema()));
log.debug("Schema versionId {}", version);

var dataschema = schemaRegistryUrl + "/subjects/" + subjectName + "/versions/" + version + "/schema";
Expand Down Expand Up @@ -147,7 +147,7 @@ public String canonicalString() {
}

@Override
public boolean isBackwardCompatible(ParsedSchema arg0) {
public List<String> isBackwardCompatible(ParsedSchema arg0) {
throw new UnsupportedOperationException();
}

Expand Down