From f4181111ccc08279585a3a28bfbf257191c26a55 Mon Sep 17 00:00:00 2001 From: eruizgar91 Date: Tue, 24 Mar 2020 13:57:02 +0100 Subject: [PATCH] Log records schemas to be compatible with postgres --- src/main/resources/avro/LogDetailsRecord.avsc | 3 +- .../avro/LogDetailsRecordPostgres.avsc | 64 +++++++++++++++++++ .../resources/avro/LogRecordPostgres.avsc | 22 +++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/avro/LogDetailsRecordPostgres.avsc create mode 100644 src/main/resources/avro/LogRecordPostgres.avsc diff --git a/src/main/resources/avro/LogDetailsRecord.avsc b/src/main/resources/avro/LogDetailsRecord.avsc index 3b5851b..d7f7458 100644 --- a/src/main/resources/avro/LogDetailsRecord.avsc +++ b/src/main/resources/avro/LogDetailsRecord.avsc @@ -14,8 +14,9 @@ { "name": "topics", "type": { + "name": "topic", "type": "array", - "items": ["string"] + "items": "string" } }, { diff --git a/src/main/resources/avro/LogDetailsRecordPostgres.avsc b/src/main/resources/avro/LogDetailsRecordPostgres.avsc new file mode 100644 index 0000000..1a09cd6 --- /dev/null +++ b/src/main/resources/avro/LogDetailsRecordPostgres.avsc @@ -0,0 +1,64 @@ +{ + "namespace": "io.keyko.monitoring.schemas", + "type": "record", + "name": "LogDetailsRecordPostgres", + "fields": [ + { + "name": "nodeName", + "type": "string" + }, + { + "name": "data", + "type":"string" + }, + { + "name": "topic0", + "type": "string", + "default": "" + }, + { + "name": "topic1", + "type": "string", + "default": "" + }, + { + "name": "topic2", + "type": "string", + "default": "" + }, + { + "name": "topic3", + "type": "string", + "default": "" + }, + { + "name": "transactionHash", + "type": "string" + }, + { + "name": "logIndex", + "type": "string", + "java-class": "java.math.BigInteger" + }, + { + "name": "blockNumber", + "type": "long" + }, + { + "name": "blockHash", + "type": "string" + }, + { + "name": "address", + "type": "string" + }, + { + "name": "networkName", + "type": "string" + }, + { + "name": "id", + "type": "string" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/avro/LogRecordPostgres.avsc b/src/main/resources/avro/LogRecordPostgres.avsc new file mode 100644 index 0000000..0015281 --- /dev/null +++ b/src/main/resources/avro/LogRecordPostgres.avsc @@ -0,0 +1,22 @@ +{ + "namespace": "io.keyko.monitoring.schemas", + "type": "record", + "name": "LogRecordPostgres", + "fields": [{ + "name": "id", + "type": "string" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "details", + "type": "LogDetailsRecordPostgres" + }, + { + "name": "retries", + "type": "int" + } + ] +} \ No newline at end of file