DBZ-651 Support for JSON key and Avro value
This commit is contained in:
parent
7c56f39414
commit
8dd8189e67
@ -105,6 +105,9 @@ else if (beans.size() > 1) {
|
||||
if (keyFormat == Json.class && valueFormat == Json.class) {
|
||||
builder = createJsonJson(consumer);
|
||||
}
|
||||
else if (keyFormat == Json.class && valueFormat == Avro.class) {
|
||||
builder = createJsonAvro(consumer);
|
||||
}
|
||||
else if (keyFormat == Avro.class && valueFormat == Avro.class) {
|
||||
builder = createAvroAvro(consumer);
|
||||
}
|
||||
@ -130,6 +133,12 @@ final DebeziumEngine.Builder<?> createAvroAvro(DebeziumEngine.ChangeConsumer<?>
|
||||
.notifying((DebeziumEngine.ChangeConsumer<ChangeEvent<byte[], byte[]>>) consumer);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final DebeziumEngine.Builder<?> createJsonAvro(DebeziumEngine.ChangeConsumer<?> consumer) {
|
||||
return DebeziumEngine.create(Json.class, Avro.class)
|
||||
.notifying((DebeziumEngine.ChangeConsumer<ChangeEvent<String, byte[]>>) consumer);
|
||||
}
|
||||
|
||||
private Properties configToProperties(Config config) {
|
||||
final Properties props = new Properties();
|
||||
for (String name : config.getPropertyNames()) {
|
||||
|
Loading…
Reference in New Issue
Block a user