From 13d20ae845d9c44403cf381200da2c5fda362b44 Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 15 May 2024 11:48:02 -0400 Subject: [PATCH 01/28] feat: replace static event name with dynamic based on event id --- .../filesystem/internal/FilesystemEventFormatter.java | 4 +--- .../exporter/otlp/internal/serializer/EventReader.java | 3 ++- .../exporter/stdout/internal/StdoutExporterContext.java | 6 ++++++ .../exporter/stdout/internal/stream/StdoutEventsStream.java | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java index 1a64df8309..f12b80fdaf 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java +++ b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java @@ -25,8 +25,6 @@ public final class FilesystemEventFormatter implements EventFormatterSpi { - private static final String FILE_NOT_FOUND = "FILE_NOT_FOUND %s"; - private final EventFW eventRO = new EventFW(); private final FilesystemEventExFW schemaRegistryEventExRO = new FilesystemEventExFW(); @@ -49,7 +47,7 @@ public String format( case FILE_NOT_FOUND: { FilesystemFileNotFoundExFW ex = extension.fileNotFound(); - result = String.format(FILE_NOT_FOUND, asString(ex.location())); + result = String.format("%s", asString(ex.location())); break; } } diff --git a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java index 38da490ef9..b5865ef347 100644 --- a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java +++ b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java @@ -76,10 +76,11 @@ private void handleEvent( eventJson.add(TIME_UNIX_NANO, nanos); eventJson.add(OBSERVED_TIME_UNIX_NANO, nanos); String qname = context.supplyQName(event.namespacedId()); + String eventName = context.supplyLocalName(event.id()).replace('.', '_').toUpperCase(); String extension = formatter.format(msgTypeId, buffer, index, length); + addStringAttribute("event.name", eventName); addBody(qname, extension); eventAttributesJson = Json.createArrayBuilder(); - addStringAttribute("event.name", context.supplyLocalName(event.id())); eventJson.add(ATTRIBUTES, eventAttributesJson); eventsJson.add(eventJson); } diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java index c7cdec617b..33557aae95 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java @@ -64,6 +64,12 @@ public String supplyQName( return context.supplyQName(namespacedId); } + public String supplyLocalName( + long namespacedId) + { + return context.supplyLocalName(namespacedId); + } + public EventFormatter supplyEventFormatter() { return context.supplyEventFormatter(); diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java index 1a866e87c2..c162a57ceb 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java @@ -29,7 +29,8 @@ public class StdoutEventsStream { - private static final String FORMAT = "%s [%s] %s%n"; // qname [timestamp] extension\n + // {zilla namespace}:{component name} [dd/MMM/yyyy:HH:mm:ss Z] {event name} - {event body}\n + private static final String FORMAT = "%s [%s] %s - %s%n"; private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd/MMM/yyyy:HH:mm:ss Z"); private final StdoutExporterContext context; @@ -61,8 +62,9 @@ private void handleEvent( { final EventFW event = eventRO.wrap(buffer, index, index + length); String qname = context.supplyQName(event.namespacedId()); + String eventName = context.supplyLocalName(event.id()).replace('.', '_').toUpperCase(); String extension = formatter.format(msgTypeId, buffer, index, length); - out.format(FORMAT, qname, asDateTime(event.timestamp()), extension); + out.format(FORMAT, qname, asDateTime(event.timestamp()), eventName, extension); } private static String asDateTime( From 8c447230800bda4264f0cd261caa4503c6a96844 Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 15 May 2024 12:30:11 -0400 Subject: [PATCH 02/28] update event.name test value --- .../zilla/specs/exporter/otlp/application/event/client.rpt | 2 +- .../zilla/specs/exporter/otlp/application/event/server.rpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt index ac70d76711..96bb6a9a1e 100644 --- a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt +++ b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/client.rpt @@ -51,7 +51,7 @@ write '{' '"key":"event.name",' '"value":{' - '"stringValue":"binding.test.connected"' + '"stringValue":"BINDING_TEST_CONNECTED"' '}' '}' ']' diff --git a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt index 8f79319539..8ca3aa4dad 100644 --- a/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt +++ b/specs/exporter-otlp.spec/src/main/scripts/io/aklivity/zilla/specs/exporter/otlp/application/event/server.rpt @@ -52,7 +52,7 @@ read '{' '"key":"event.name",' '"value":{' - '"stringValue":"binding.test.connected"' + '"stringValue":"BINDING_TEST_CONNECTED"' '}' '}' ']' From db6c24921de9532546db5abbc69ecbbe2e242b58 Mon Sep 17 00:00:00 2001 From: AJ Danelz Date: Wed, 15 May 2024 13:50:48 -0400 Subject: [PATCH 03/28] Update incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java Co-authored-by: John Fallows --- .../catalog/filesystem/internal/FilesystemEventFormatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java index f12b80fdaf..5bc42853c0 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java +++ b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java @@ -26,7 +26,7 @@ public final class FilesystemEventFormatter implements EventFormatterSpi { private final EventFW eventRO = new EventFW(); - private final FilesystemEventExFW schemaRegistryEventExRO = new FilesystemEventExFW(); + private final FilesystemEventExFW filesystemEventExRO = new FilesystemEventExFW(); FilesystemEventFormatter( Configuration config) From a9b16cd9e0bb5af1e1ed5fc9f5577570fd291aed Mon Sep 17 00:00:00 2001 From: AJ Danelz Date: Wed, 15 May 2024 13:53:24 -0400 Subject: [PATCH 04/28] Update runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java Co-authored-by: John Fallows --- .../exporter/stdout/internal/StdoutExporterContext.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java index 33557aae95..70658d3b58 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/StdoutExporterContext.java @@ -64,10 +64,10 @@ public String supplyQName( return context.supplyQName(namespacedId); } - public String supplyLocalName( - long namespacedId) + public String supplyEventName( + int eventId) { - return context.supplyLocalName(namespacedId); + return context.supplyEventName(eventId); } public EventFormatter supplyEventFormatter() From db918eb176336d949e9e0275ddd8a8d399819ef6 Mon Sep 17 00:00:00 2001 From: AJ Danelz Date: Wed, 15 May 2024 13:53:33 -0400 Subject: [PATCH 05/28] Update runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java Co-authored-by: John Fallows --- .../runtime/exporter/otlp/internal/serializer/EventReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java index b5865ef347..576457bafd 100644 --- a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java +++ b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java @@ -76,7 +76,7 @@ private void handleEvent( eventJson.add(TIME_UNIX_NANO, nanos); eventJson.add(OBSERVED_TIME_UNIX_NANO, nanos); String qname = context.supplyQName(event.namespacedId()); - String eventName = context.supplyLocalName(event.id()).replace('.', '_').toUpperCase(); + String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); addStringAttribute("event.name", eventName); addBody(qname, extension); From 5b3b00dc02ae04aa06bd70503ed56a687f68c8e3 Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 15 May 2024 14:37:17 -0400 Subject: [PATCH 06/28] Build event name in Engine context --- .../internal/FilesystemEventFormatter.java | 2 +- .../zilla/runtime/engine/EngineContext.java | 3 +++ .../engine/internal/registry/EngineWorker.java | 15 +++++++++++++++ .../internal/stream/StdoutEventsStream.java | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java index 5bc42853c0..8f1f75d51e 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java +++ b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java @@ -39,7 +39,7 @@ public String format( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); - final FilesystemEventExFW extension = schemaRegistryEventExRO + final FilesystemEventExFW extension = filesystemEventExRO .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); String result = null; switch (extension.kind()) diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java index 15628a3b60..3c6f81931e 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/EngineContext.java @@ -134,6 +134,9 @@ String supplyQName( int supplyEventId( String name); + String supplyEventName( + int eventId); + BindingHandler streamFactory(); GuardHandler supplyGuard( diff --git a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java index 0d535e2d8a..bc4b731109 100644 --- a/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java +++ b/runtime/engine/src/main/java/io/aklivity/zilla/runtime/engine/internal/registry/EngineWorker.java @@ -224,6 +224,7 @@ public class EngineWorker implements EngineContext, Agent private final ScalarsLayout gaugesLayout; private final HistogramsLayout histogramsLayout; private final EventsLayout eventsLayout; + private final Int2ObjectHashMap eventNames; private final Supplier supplyEventReader; private final EventFormatterFactory eventFormatterFactory; @@ -311,6 +312,7 @@ public EngineWorker( .path(config.directory().resolve(String.format("events%d", index))) .capacity(config.eventsBufferCapacity()) .build(); + this.eventNames = new Int2ObjectHashMap<>(); this.agentName = String.format("engine/data#%d", index); this.streamsLayout = streamsLayout; @@ -485,6 +487,13 @@ public int supplyEventId( return labels.supplyLabelId(name); } + @Override + public String supplyEventName( + int eventId) + { + return eventNames.computeIfAbsent(eventId, this::computeEventName); + } + @Override public int supplyTypeId( String name) @@ -1733,6 +1742,12 @@ public EventFormatter supplyEventFormatter() return eventFormatterFactory.create(config, this); } + private String computeEventName( + int eventId) + { + return supplyLocalName(eventId).replace('.', '_').toUpperCase(); + } + private MessageConsumer supplyWriter( int index) { diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java index c162a57ceb..5ed47340c6 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java @@ -62,7 +62,7 @@ private void handleEvent( { final EventFW event = eventRO.wrap(buffer, index, index + length); String qname = context.supplyQName(event.namespacedId()); - String eventName = context.supplyLocalName(event.id()).replace('.', '_').toUpperCase(); + String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); out.format(FORMAT, qname, asDateTime(event.timestamp()), eventName, extension); } From 35f32544144c7c85c77ca3fdc8efcc62fb7e66f4 Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 16 May 2024 11:58:08 -0400 Subject: [PATCH 07/28] fix build errors --- .../runtime/binding/echo/internal/bench/EchoWorker.java | 7 +++++++ .../runtime/binding/tls/internal/bench/TlsWorker.java | 7 +++++++ .../exporter/otlp/internal/serializer/EventReader.java | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java index 175b20f3cf..a2e35d4ca8 100644 --- a/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java +++ b/runtime/binding-echo/src/test/java/io/aklivity/zilla/runtime/binding/echo/internal/bench/EchoWorker.java @@ -263,6 +263,13 @@ public int supplyEventId( return 0; } + @Override + public String supplyEventName( + int eventId) + { + return ""; + } + @Override public BindingHandler streamFactory() { diff --git a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java index 8f0ad77e20..308cdd011d 100644 --- a/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java +++ b/runtime/binding-tls/src/test/java/io/aklivity/zilla/runtime/binding/tls/internal/bench/TlsWorker.java @@ -331,6 +331,13 @@ public int supplyEventId( return 0; } + @Override + public String supplyEventName( + int eventId) + { + return ""; + } + @Override public BindingHandler streamFactory() { diff --git a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java index 576457bafd..63cc4349e8 100644 --- a/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java +++ b/runtime/exporter-otlp/src/main/java/io/aklivity/zilla/runtime/exporter/otlp/internal/serializer/EventReader.java @@ -78,9 +78,9 @@ private void handleEvent( String qname = context.supplyQName(event.namespacedId()); String eventName = context.supplyEventName(event.id()); String extension = formatter.format(msgTypeId, buffer, index, length); + eventAttributesJson = Json.createArrayBuilder(); addStringAttribute("event.name", eventName); addBody(qname, extension); - eventAttributesJson = Json.createArrayBuilder(); eventJson.add(ATTRIBUTES, eventAttributesJson); eventsJson.add(eventJson); } From 56088290d72c6867f786cebe22546385161113db Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 16 May 2024 12:58:45 -0400 Subject: [PATCH 08/28] update tests --- .../specs/catalog/filesystem/config/event.yaml | 3 ++- .../http/internal/HttpEventFormatter.java | 4 +--- .../kafka/internal/KafkaEventFormatter.java | 7 ++----- .../binding/tcp/internal/TcpEventFormatter.java | 4 +--- .../binding/tls/internal/TlsEventFormatter.java | 16 +++++----------- .../internal/KarapaceEventFormatter.java | 17 +++++------------ .../internal/exporter/TestExporterHandler.java | 7 ++++--- .../config/TestExporterOptionsConfig.java | 9 ++++++--- .../TestExporterOptionsConfigAdapter.java | 9 ++++++++- .../TestExporterOptionsConfigBuilder.java | 3 ++- .../stdout/internal/events/EventIT.java | 2 +- .../guard/jwt/internal/JwtEventFormatter.java | 4 +--- .../avro/internal/AvroModelEventFormatter.java | 4 +--- .../core/internal/CoreModelEventFormatter.java | 4 +--- .../json/internal/JsonModelEventFormatter.java | 4 +--- .../internal/ProtobufModelEventFormatter.java | 4 +--- .../binding/http/config/v1.1/server.event.yaml | 3 ++- .../binding/http/config/v2/server.event.yaml | 3 ++- .../binding/kafka/config/client.event.yaml | 3 ++- .../specs/binding/tcp/config/client.event.yaml | 3 ++- .../specs/binding/tls/config/client.event.yaml | 3 ++- .../config/server.event.handshake.failed.yaml | 3 ++- .../tls/config/server.event.tls.failed.yaml | 3 ++- .../id/subject/version/failed/zilla.yaml | 3 +++ .../config/resolve/schema/id/retry/zilla.yaml | 6 ++++-- .../resolve/subject/version/retry/zilla.yaml | 9 ++++++--- .../config/unretrievable/schema/id/zilla.yaml | 3 ++- .../schema/subject/version/zilla.yaml | 3 ++- .../zilla/specs/engine/config/server.event.yaml | 1 + .../zilla/specs/guard/jwt/config/event.yaml | 3 ++- .../zilla/specs/model/avro/config/event.yaml | 3 ++- .../zilla/specs/model/core/config/event.yaml | 3 ++- .../zilla/specs/model/json/config/event.yaml | 3 ++- .../specs/model/protobuf/config/event.yaml | 3 ++- 34 files changed, 84 insertions(+), 78 deletions(-) diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml b/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml index 7200e67713..34625b0f02 100644 --- a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml +++ b/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.filesystem.file.not.found - message: FILE_NOT_FOUND asyncapi/kafka.yaml + name: CATALOG_FILESYSTEM_FILE_NOT_FOUND + message: asyncapi/kafka.yaml catalogs: catalog0: type: filesystem diff --git a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java index 221b3097a8..abacfa256d 100644 --- a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java +++ b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java @@ -26,8 +26,6 @@ public final class HttpEventFormatter implements EventFormatterSpi { - private static final String REQUEST_ACCEPTED_FORMAT = "REQUEST_ACCEPTED %s %s %s %s %s"; - private final EventFW eventRO = new EventFW(); private final HttpEventExFW httpEventExRO = new HttpEventExFW(); @@ -50,7 +48,7 @@ public String format( case REQUEST_ACCEPTED: { HttpRequestAcceptedExFW ex = extension.requestAccepted(); - result = String.format(REQUEST_ACCEPTED_FORMAT, identity(ex.identity()), asString(ex.scheme()), asString(ex.method()), + result = String.format("%s %s %s %s %s", identity(ex.identity()), asString(ex.scheme()), asString(ex.method()), asString(ex.authority()), asString(ex.path())); break; } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java index 515aa6f08e..b6fdda29dc 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java @@ -27,9 +27,6 @@ public final class KafkaEventFormatter implements EventFormatterSpi { - private static final String AUTHORIZATION_FAILED_FORMAT = "AUTHORIZATION_FAILED %s"; - private static final String API_VERSION_REJECTED_FORMAT = "API_VERSION_REJECTED %d %d"; - private final EventFW eventRO = new EventFW(); private final KafkaEventExFW kafkaEventExRO = new KafkaEventExFW(); @@ -52,13 +49,13 @@ public String format( case AUTHORIZATION_FAILED: { KafkaAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format(AUTHORIZATION_FAILED_FORMAT, identity(ex.identity())); + result = String.format("%s", identity(ex.identity())); break; } case API_VERSION_REJECTED: { final KafkaApiVersionRejectedExFW ex = extension.apiVersionRejected(); - result = String.format(API_VERSION_REJECTED_FORMAT, ex.apiKey(), ex.apiVersion()); + result = String.format("%d %d", ex.apiKey(), ex.apiVersion()); } } return result; diff --git a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java index 5fd1716db2..188a0675ec 100644 --- a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java +++ b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java @@ -26,8 +26,6 @@ public final class TcpEventFormatter implements EventFormatterSpi { - private static final String DNS_FAILED_FORMAT = "DNS_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final TcpEventExFW tcpEventExRO = new TcpEventExFW(); @@ -50,7 +48,7 @@ public String format( case DNS_FAILED: { final TcpDnsFailedExFW ex = extension.dnsFailed(); - result = String.format(DNS_FAILED_FORMAT, asString(ex.address())); + result = String.format("%s", asString(ex.address())); break; } } diff --git a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java index 49a03c9cb5..6a11d31c22 100644 --- a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java +++ b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java @@ -24,12 +24,6 @@ public final class TlsEventFormatter implements EventFormatterSpi { - private static final String TLS_FAILED_FORMAT = "TLS_FAILED"; - private static final String PROTOCOL_REJECTED_FORMAT = "PROTOCOL_REJECTED"; - private static final String KEY_REJECTED_FORMAT = "KEY_REJECTED"; - private static final String PEER_NOT_VERIFIED_FORMAT = "PEER_NOT_VERIFIED"; - private static final String HANDSHAKE_FAILED_FORMAT = "HANDSHAKE_FAILED"; - private final EventFW eventRO = new EventFW(); private final TlsEventExFW tlsEventExRO = new TlsEventExFW(); @@ -51,27 +45,27 @@ public String format( { case TLS_FAILED: { - result = TLS_FAILED_FORMAT; + result = ""; break; } case TLS_PROTOCOL_REJECTED: { - result = PROTOCOL_REJECTED_FORMAT; + result = ""; break; } case TLS_KEY_REJECTED: { - result = KEY_REJECTED_FORMAT; + result = ""; break; } case TLS_PEER_NOT_VERIFIED: { - result = PEER_NOT_VERIFIED_FORMAT; + result = ""; break; } case TLS_HANDSHAKE_FAILED: { - result = HANDSHAKE_FAILED_FORMAT; + result = ""; break; } } diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java index 8c342dd962..d00d0d8780 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java @@ -29,13 +29,6 @@ public final class KarapaceEventFormatter implements EventFormatterSpi { - private static final String UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION = "UNRETRIEVABLE_SCHEMA %s %s"; - private static final String UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA = - "UNRETRIEVABLE_SCHEMA %s %s, USING_STALE_SCHEMA %d"; - private static final String UNRETRIEVABLE_SCHEMA_ID = "UNRETRIEVABLE_SCHEMA_ID %d"; - private static final String RETRIEVED_SCHEMA_SUBJECT_VERSION = "RETRIEVED_SCHEMA_SUBJECT_VERSION %s %s"; - private static final String RETRIEVED_SCHEMA_ID = "RETRIEVED_SCHEMA_ID %d"; - private final EventFW eventRO = new EventFW(); private final KarapaceEventExFW karapaceEventExRO = new KarapaceEventExFW(); @@ -58,33 +51,33 @@ public String format( case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: { KarapaceUnretrievableSchemaSubjectVersionExFW ex = extension.unretrievableSchemaSubjectVersion(); - result = String.format(UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); break; } case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: { KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW ex = extension .unretrievableSchemaSubjectVersionStaleSchema(); - result = String.format(UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA, asString(ex.subject()), + result = String.format("%s %s, using stale schema: %d", asString(ex.subject()), asString(ex.version()), ex.schemaId()); break; } case UNRETRIEVABLE_SCHEMA_ID: { KarapaceUnretrievableSchemaIdExFW ex = extension.unretrievableSchemaId(); - result = String.format(UNRETRIEVABLE_SCHEMA_ID, ex.schemaId()); + result = String.format("%d", ex.schemaId()); break; } case RETRIEVED_SCHEMA_SUBJECT_VERSION: { KarapaceRetrievableSchemaSubjectVersionExFW ex = extension.retrievableSchemaSubjectVersion(); - result = String.format(RETRIEVED_SCHEMA_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); break; } case RETRIEVED_SCHEMA_ID: { KarapaceRetrievableSchemaIdExFW ex = extension.retrievableSchemaId(); - result = String.format(RETRIEVED_SCHEMA_ID, ex.schemaId()); + result = String.format("%d", ex.schemaId()); break; } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java index 1588e9ab43..2dc8dd772b 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/TestExporterHandler.java @@ -70,14 +70,15 @@ private void handleEvent( final EventFW event = eventRO.wrap(buffer, index, index + length); String qname = context.supplyQName(event.namespacedId()); String id = context.supplyLocalName(event.id()); + String name = context.supplyEventName(event.id()); String message = formatter.format(msgTypeId, buffer, index, length); if (options.events != null && eventIndex < options.events.size()) { TestExporterOptionsConfig.Event e = options.events.get(eventIndex); - if (!qname.equals(e.qName) || !id.equals(e.id) || !message.equals(e.message)) + if (!qname.equals(e.qName) || !id.equals(e.id) || !name.equals(e.name) || !message.equals(e.message)) { - throw new IllegalStateException(String.format("event mismatch, expected: %s %s %s, got: %s %s %s", - e.qName, e.id, e.message, qname, id, message)); + throw new IllegalStateException(String.format("event mismatch, expected: %s %s %s %s, got: %s %s %s %s", + e.qName, e.id, e.name, e.message, qname, id, name, message)); } eventIndex++; } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java index ac572a23cc..d148044b07 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfig.java @@ -48,15 +48,18 @@ public static final class Event { public final String qName; public final String id; + public final String name; public final String message; public Event( - String qName, - String id, - String message) + String qName, + String id, + String name, + String message) { this.qName = qName; this.id = id; + this.name = name; this.message = message; } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java index 2af4e8fdf4..5c119416df 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigAdapter.java @@ -33,6 +33,7 @@ public final class TestExporterOptionsConfigAdapter implements OptionsConfigAdap private static final String EVENTS_NAME = "events"; private static final String QNAME_NAME = "qname"; private static final String ID_NAME = "id"; + private static final String NAME_NAME = "name"; private static final String MESSAGE_NAME = "message"; @Override @@ -68,6 +69,7 @@ public JsonObject adaptToJson( JsonObjectBuilder event = Json.createObjectBuilder(); event.add(QNAME_NAME, e.qName); event.add(ID_NAME, e.id); + event.add(NAME_NAME, e.name); event.add(MESSAGE_NAME, e.message); events.add(event); } @@ -98,7 +100,12 @@ public OptionsConfig adaptFromJson( JsonObject e0 = e.asJsonObject(); if (e0.containsKey(QNAME_NAME) && e0.containsKey(MESSAGE_NAME)) { - testOptions.event(e0.getString(QNAME_NAME), e0.getString(ID_NAME), e0.getString(MESSAGE_NAME)); + testOptions.event( + e0.getString(QNAME_NAME), + e0.getString(ID_NAME), + e0.getString(NAME_NAME), + e0.getString(MESSAGE_NAME) + ); } } } diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java index 6b871d36b0..62c9d57776 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/exporter/config/TestExporterOptionsConfigBuilder.java @@ -52,13 +52,14 @@ public TestExporterOptionsConfigBuilder mode( public TestExporterOptionsConfigBuilder event( String qName, String id, + String name, String message) { if (this.events == null) { this.events = new LinkedList<>(); } - this.events.add(new TestExporterOptionsConfig.Event(qName, id, message)); + this.events.add(new TestExporterOptionsConfig.Event(qName, id, name, message)); return this; } diff --git a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java index c5b019b33e..9e7aaced03 100644 --- a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java +++ b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java @@ -63,6 +63,6 @@ public class EventIT public void shouldLogEvents() throws Exception { k3po.finish(); - output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] test event message\n")); + output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] BINDING_TEST_CONNECTED - test event message\n")); } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java index 36282d3a48..927c3927bf 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java @@ -25,8 +25,6 @@ public final class JwtEventFormatter implements EventFormatterSpi { - private static final String AUTHORIZATION_FAILED_FORMAT = "AUTHORIZATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final JwtEventExFW jwtEventExRO = new JwtEventExFW(); @@ -49,7 +47,7 @@ public String format( case AUTHORIZATION_FAILED: { JwtAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format(AUTHORIZATION_FAILED_FORMAT, identity(ex.identity())); + result = String.format("%s", identity(ex.identity())); break; } } diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java index ab60c4de2f..45727075e6 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java @@ -25,8 +25,6 @@ public final class AvroModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final AvroModelEventExFW jsonModelEventExFW = new AvroModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { AvroModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("%s", asString(ex.error())); break; } } diff --git a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java index 36fef012ce..0a4b2f0b32 100644 --- a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java +++ b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java @@ -25,8 +25,6 @@ public final class CoreModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final CoreModelEventExFW coreModelEventExFW = new CoreModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { CoreModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("%s", asString(ex.error())); break; } } diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java index c0886ac5c5..e831a8ad2f 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java @@ -25,8 +25,6 @@ public final class JsonModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final JsonModelEventExFW jsonModelEventExFW = new JsonModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { JsonModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("%s", asString(ex.error())); break; } } diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java index ea5ee06b61..bc3cf37ba7 100644 --- a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java @@ -25,8 +25,6 @@ public final class ProtobufModelEventFormatter implements EventFormatterSpi { - private static final String VALIDATION_FAILED = "VALIDATION_FAILED %s"; - private final EventFW eventRO = new EventFW(); private final ProtobufModelEventExFW protobufModelEventExFW = new ProtobufModelEventExFW(); @@ -49,7 +47,7 @@ public String format( case VALIDATION_FAILED: { ProtobufModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format(VALIDATION_FAILED, asString(ex.error())); + result = String.format("%s", asString(ex.error())); break; } } diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml index 8411e8348e..942df1e6d8 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.http.request.accepted - message: REQUEST_ACCEPTED - http GET localhost:8080 / + name: BINDING_HTTP_REQUEST_ACCEPTED + message: http GET localhost:8080 / bindings: net0: type: http diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml index 0a1cebed55..40057bb219 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.http.request.accepted - message: REQUEST_ACCEPTED - http GET localhost:8080 / + name: BINDING_HTTP_REQUEST_ACCEPTED + message: http GET localhost:8080 / bindings: net0: type: http diff --git a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml index 1fde456a84..3610b32b36 100644 --- a/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml +++ b/specs/binding-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/kafka/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.kafka.api.version.rejected - message: API_VERSION_REJECTED 32 0 + name: BINDING_KAFKA_API_VERSION_REJECTED + message: 32 0 bindings: app0: type: kafka diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml index 773339141c..e729f02b62 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.tcp.dns.failed - message: DNS_FAILED localhost + name: BINDING_TCP_DNS_FAILED + message: localhost bindings: app0: type: tcp diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml index 0a9021abdb..dd6913bd7b 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.app0 id: binding.tls.handshake.failed - message: HANDSHAKE_FAILED + name: HANDSHAKE_FAILED + message: "" vaults: client: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml index 97d01e2526..50a4b902d1 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.tls.handshake.failed - message: HANDSHAKE_FAILED + name: BINDING_TLS_HANDSHAKE_FAILED + message: "" vaults: server: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml index f9a4e5a794..023cb171bf 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.tls.tls.failed - message: TLS_FAILED + name: BINDING_TLS_TLS_FAILED + message: "" vaults: server: type: filesystem diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml index 2c391e7ae5..78b4c818ce 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml @@ -22,6 +22,9 @@ telemetry: options: events: - qname: test.catalog0 + id: catalog.apicurio.remote.access.rejected + name: CATALOG_APICURIO_REMOTE_ACCESS_REJECTED + message: GET http://localhost:8081/apis/registry/v2/ids/globalIds/1 0 id: catalog.apicurio.unretrievable.artifact.subject.version message: UNRETRIEVABLE_ARTIFACT artifactId latest catalogs: diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml index 47edd6afed..18c8b7317a 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml @@ -23,10 +23,12 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id - message: UNRETRIEVABLE_SCHEMA_ID 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID + message: 9 - qname: test.catalog0 id: catalog.karapace.retrievable.schema.id - message: RETRIEVED_SCHEMA_ID 9 + name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_ID + message: 9 catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml index cfebc5d347..b425b918d1 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml @@ -23,13 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA + message: items-snapshots-value latest - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version.stale.schema - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest, USING_STALE_SCHEMA 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA + message: items-snapshots-value latest, USING_STALE_SCHEMA 9 - qname: test.catalog0 id: catalog.karapace.retrievable.schema.subject.version - message: RETRIEVED_SCHEMA_SUBJECT_VERSION items-snapshots-value latest + name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_SUBJECT_VERSION + message: items-snapshots-value latest catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml index 0cdf18ac5f..c12bc168b9 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id - message: UNRETRIEVABLE_SCHEMA_ID 1 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID + message: 1 catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml index 094974fe4b..2adde1fdc7 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - message: UNRETRIEVABLE_SCHEMA items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA + message: items-snapshots-value latest catalogs: catalog0: type: karapace diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml index 7700f1a82b..2053ab0d4e 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/config/server.event.yaml @@ -24,6 +24,7 @@ telemetry: events: - qname: test.net0 id: binding.test.connected + name: BINDING_TEST_CONNECTED message: test event message bindings: net0: diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml index 4b85ea2070..1e4b518dc0 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: guard.jwt.authorization.failed - message: AUTHORIZATION_FAILED user + name: GUARD_JWT_AUTHORIZATION_FAILED + message: user guards: jwt0: type: jwt diff --git a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml index 2f90087d02..e8034247fa 100644 --- a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml +++ b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.avro.validation.failed - message: VALIDATION_FAILED java.io.EOFException + name: MODEL_AVRO_VALIDATION_FAILED + message: java.io.EOFException catalogs: test0: type: test diff --git a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml index 0eb313abbe..170b977115 100644 --- a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml +++ b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.core.validation.failed - message: VALIDATION_FAILED string + name: MODEL_CORE_VALIDATION_FAILED + message: string bindings: net0: kind: server diff --git a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml index af289dce90..1184cdcfb3 100644 --- a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml +++ b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.json.validation.failed - message: VALIDATION_FAILED [1,10][/id] The value must be of string type, but actual type is integer. + name: MODEL_JSON_VALIDATION_FAILED + message: [1,10][/id] The value must be of string type, but actual type is integer. catalogs: test0: type: test diff --git a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml index 2aa546c91b..3f55e8a7cc 100644 --- a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml +++ b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.net0 id: model.protobuf.validation.failed - message: "VALIDATION_FAILED Cannot find field: date in message example" + name: MODEL_PROTOBUF_VALIDATION_FAILED + message: "Cannot find field: date in message example" catalogs: test0: type: test From 34deb1806b014fa8cfff32e6834d3881cfa61b71 Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 16 May 2024 15:33:43 -0400 Subject: [PATCH 09/28] fix http binding event test --- .../exporter/stdout/internal/stream/StdoutEventsStream.java | 4 ++-- .../zilla/specs/binding/http/config/v1.1/server.event.yaml | 2 +- .../zilla/specs/binding/http/config/v2/server.event.yaml | 2 +- .../zilla/specs/engine/schema/exporter/test.schema.patch.json | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java index 5ed47340c6..9d30138409 100644 --- a/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java +++ b/runtime/exporter-stdout/src/main/java/io/aklivity/zilla/runtime/exporter/stdout/internal/stream/StdoutEventsStream.java @@ -29,8 +29,8 @@ public class StdoutEventsStream { - // {zilla namespace}:{component name} [dd/MMM/yyyy:HH:mm:ss Z] {event name} - {event body}\n - private static final String FORMAT = "%s [%s] %s - %s%n"; + // {zilla namespace}:{component name} [dd/MMM/yyyy:HH:mm:ss Z] {event name} {event body}\n + private static final String FORMAT = "%s [%s] %s %s%n"; private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("dd/MMM/yyyy:HH:mm:ss Z"); private final StdoutExporterContext context; diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml index 942df1e6d8..9bb183a10e 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.http.request.accepted name: BINDING_HTTP_REQUEST_ACCEPTED - message: http GET localhost:8080 / + message: "- http GET localhost:8080 /" bindings: net0: type: http diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml index 40057bb219..b2d5d70f60 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.http.request.accepted name: BINDING_HTTP_REQUEST_ACCEPTED - message: http GET localhost:8080 / + message: "- http GET localhost:8080 /" bindings: net0: type: http diff --git a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json index 51d1bf8be6..5992cecce6 100644 --- a/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json +++ b/specs/engine.spec/src/main/scripts/io/aklivity/zilla/specs/engine/schema/exporter/test.schema.patch.json @@ -48,6 +48,10 @@ { "type": "string" }, + "name": + { + "type": "string" + }, "message": { "type": "string" From 981fed49a34a53c50c45314d911edc61d66a02f9 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 20 May 2024 10:41:28 -0400 Subject: [PATCH 10/28] move event names out of format --- .../binding/mqtt/internal/MqttEventFormatter.java | 4 +--- .../apicurio/internal/ApicurioEventFormatter.java | 15 ++++----------- .../binding/mqtt/config/server.log.event.yaml | 3 ++- .../resolve/artifact/global/id/retry/zilla.yaml | 6 ++++-- .../artifact/id/subject/version/failed/zilla.yaml | 4 +++- .../artifact/id/subject/version/retry/zilla.yaml | 9 ++++++--- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java index ba102af34c..5768197707 100644 --- a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java +++ b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java @@ -26,8 +26,6 @@ public final class MqttEventFormatter implements EventFormatterSpi { - private static final String CLIENT_CONNECTED_FORMAT = "CLIENT_CONNECTED %s %s"; - private final EventFW eventRO = new EventFW(); private final MqttEventExFW mqttEventExRO = new MqttEventExFW(); @@ -50,7 +48,7 @@ public String format( case CLIENT_CONNECTED: { MqttClientConnectedExFW ex = extension.clientConnected(); - result = String.format(CLIENT_CONNECTED_FORMAT, identity(ex.identity()), asString(ex.clientId())); + result = String.format("%s %s", identity(ex.identity()), asString(ex.clientId())); break; } } diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java index 83947114e7..e28375b1e8 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java @@ -29,13 +29,6 @@ public final class ApicurioEventFormatter implements EventFormatterSpi { - private static final String UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION = "UNRETRIEVABLE_ARTIFACT %s %s"; - private static final String UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT = - "UNRETRIEVABLE_ARTIFACT %s %s, USING_STALE_ARTIFACT %d"; - private static final String UNRETRIEVABLE_ARTIFACT_ID = "UNRETRIEVABLE_ARTIFACT_ID %d"; - private static final String RETRIEVED_ARTIFACT_SUBJECT_VERSION = "RETRIEVED_ARTIFACT_SUBJECT_VERSION %s %s"; - private static final String RETRIEVED_ARTIFACT_ID = "RETRIEVED_ARTIFACT_ID %d"; - private final EventFW eventRO = new EventFW(); private final ApicurioEventExFW schemaRegistryEventExRO = new ApicurioEventExFW(); @@ -58,27 +51,27 @@ public String format( case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: { ApicurioUnretrievableArtifactSubjectVersionExFW ex = extension.unretrievableArtifactSubjectVersion(); - result = String.format(UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); break; } case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: { ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW ex = extension .unretrievableArtifactSubjectVersionStaleArtifact(); - result = String.format(UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT, asString(ex.subject()), + result = String.format("%s (%s) | stale artifactId (%d)", asString(ex.subject()), asString(ex.version()), ex.artifactId()); break; } case UNRETRIEVABLE_ARTIFACT_ID: { ApicurioUnretrievableArtifactIdExFW ex = extension.unretrievableArtifactId(); - result = String.format(UNRETRIEVABLE_ARTIFACT_ID, ex.artifactId()); + result = String.format("%d", ex.artifactId()); break; } case RETRIEVED_ARTIFACT_SUBJECT_VERSION: { ApicurioRetrievableArtifactSubjectVersionExFW ex = extension.retrievableArtifactSubjectVersion(); - result = String.format(RETRIEVED_ARTIFACT_SUBJECT_VERSION, asString(ex.subject()), asString(ex.version())); + result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); break; } case RETRIEVED_ARTIFACT_ID: diff --git a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml index 53d5edc154..c94d5ef5f0 100644 --- a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml +++ b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml @@ -24,7 +24,8 @@ telemetry: events: - qname: test.net0 id: binding.mqtt.client.connected - message: CLIENT_CONNECTED - client + name: BINDING_MQTT_CLIENT_CONNECTED + message: "- client" bindings: net0: type: mqtt diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml index b4983ae5ab..9f998b2728 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml @@ -23,10 +23,12 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.id - message: UNRETRIEVABLE_ARTIFACT_ID 1 + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_ID + message: 1 - qname: test.catalog0 id: catalog.apicurio.retrievable.artifact.id - message: RETRIEVED_ARTIFACT_ID 1 + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_ID + message: 1 catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml index 78b4c818ce..a840bad739 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml @@ -25,8 +25,10 @@ telemetry: id: catalog.apicurio.remote.access.rejected name: CATALOG_APICURIO_REMOTE_ACCESS_REJECTED message: GET http://localhost:8081/apis/registry/v2/ids/globalIds/1 0 + - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version - message: UNRETRIEVABLE_ARTIFACT artifactId latest + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: artifactId latest catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml index a47879431e..71cf54bcd7 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml @@ -23,13 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version - message: UNRETRIEVABLE_ARTIFACT artifactId latest + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: artifactId latest - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact - message: UNRETRIEVABLE_ARTIFACT artifactId latest, USING_STALE_ARTIFACT 1 + name: UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT + message: artifactId (latest) | stale artifactId (1) - qname: test.catalog0 id: catalog.apicurio.retrievable.artifact.subject.version - message: RETRIEVED_ARTIFACT_SUBJECT_VERSION artifactId latest + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_SUBJECT_VERSION + message: artifactId latest catalogs: catalog0: type: apicurio From 7bff9fe6f360ecf19b0c07e9bea1802614fa6e54 Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 30 May 2024 10:29:08 -0400 Subject: [PATCH 11/28] correct code to pass tests --- .../catalog/apicurio/internal/ApicurioEventFormatter.java | 2 +- .../aklivity/zilla/specs/binding/tls/config/client.event.yaml | 2 +- .../io/aklivity/zilla/specs/model/json/config/event.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java index e28375b1e8..4cbd88cac3 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java @@ -77,7 +77,7 @@ public String format( case RETRIEVED_ARTIFACT_ID: { ApicurioRetrievableArtifactIdExFW ex = extension.retrievableArtifactId(); - result = String.format(RETRIEVED_ARTIFACT_ID, ex.artifactId()); + result = String.format("$d", ex.artifactId()); break; } } diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml index dd6913bd7b..8f5ba26a93 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml @@ -24,7 +24,7 @@ telemetry: events: - qname: test.app0 id: binding.tls.handshake.failed - name: HANDSHAKE_FAILED + name: BINDING_TLS_HANDSHAKE_FAILED message: "" vaults: client: diff --git a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml index 1184cdcfb3..aca649b07c 100644 --- a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml +++ b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: model.json.validation.failed name: MODEL_JSON_VALIDATION_FAILED - message: [1,10][/id] The value must be of string type, but actual type is integer. + message: "[1,10][/id] The value must be of string type, but actual type is integer." catalogs: test0: type: test From 1ba8a8ebff71bd3fabd03ead256c669470c8d9a3 Mon Sep 17 00:00:00 2001 From: AJ Date: Thu, 30 May 2024 12:39:56 -0400 Subject: [PATCH 12/28] refactor the compact session topic event --- .../binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java | 4 +--- .../mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java | 2 +- .../specs/binding/mqtt/kafka/config/proxy.log.event.yaml | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java index 8c66ebbe31..14b9081af9 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java @@ -25,8 +25,6 @@ public final class MqttKafkaEventFormatter implements EventFormatterSpi { - private static final String NON_COMPACT_SESSIONS_TOPIC_FORMAT = "NON COMPACT SESSIONS TOPIC - %s"; - private final EventFW eventRO = new EventFW(); private final MqttKafkaEventExFW mqttKafkaEventExRO = new MqttKafkaEventExFW(); @@ -49,7 +47,7 @@ public String format( case NON_COMPACT_SESSIONS_TOPIC: { MqttKafkaResetMqttConnectionExFW ex = extension.nonCompactSessionsTopic(); - result = String.format(NON_COMPACT_SESSIONS_TOPIC_FORMAT, asString(ex.reason())); + result = String.format("%s", asString(ex.reason())); break; } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java index 7ab987ddba..a68ec1c94e 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java @@ -170,7 +170,7 @@ public class MqttKafkaSessionFactory implements MqttKafkaStreamFactory public static final int MQTT_NOT_AUTHORIZED = 0x87; public static final int MQTT_IMPLEMENTATION_SPECIFIC_ERROR = 0x83; public static final String MQTT_INVALID_SESSION_TIMEOUT_REASON = "Invalid session expiry interval"; - public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("Sessions Kafka topic in non-compacted"); + public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("The Sessions Kafka topic is non-compacted"); private static final KafkaConfigFW CONFIG_COMPACT_CLEANUP_POLICY = new KafkaConfigFW.Builder() .wrap(new UnsafeBuffer(new byte[25]), 0, 25) .name("cleanup.policy") diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml index f6c94af5cc..4d2bef19db 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml @@ -23,7 +23,8 @@ telemetry: events: - qname: test.kafka0 id: binding.mqtt.kafka.non.compact.sessions.topic - message: NON COMPACT SESSIONS TOPIC - Sessions Kafka topic in non-compacted + name: BINDING_MQTT_KAFKA_NON_COMPACT_SESSIONS_TOPIC + message: The Sessions Kafka topic is non-compacted bindings: mqtt0: type: mqtt-kafka From 30430b803ff4f86e572c3bf0126a6ab40e81cd21 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 10:26:35 -0400 Subject: [PATCH 13/28] move the static reason into the event formatter --- .../binding/mqtt/kafka/internal/MqttKafkaEventContext.java | 7 ++----- .../mqtt/kafka/internal/MqttKafkaEventFormatter.java | 4 +++- .../kafka/internal/stream/MqttKafkaSessionFactory.java | 3 +-- .../src/main/resources/META-INF/zilla/mqtt_kafka.idl | 1 - .../specs/binding/mqtt/kafka/config/proxy.log.event.yaml | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java index f62228de03..caab30d7d7 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java @@ -22,7 +22,6 @@ import org.agrona.concurrent.AtomicBuffer; import org.agrona.concurrent.UnsafeBuffer; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.EventFW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaEventExFW; import io.aklivity.zilla.runtime.engine.EngineContext; @@ -52,14 +51,12 @@ public MqttKafkaEventContext( public void onMqttConnectionReset( long traceId, - long bindingId, - String16FW reason) + long bindingId) { MqttKafkaEventExFW extension = mqttKafkaEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .nonCompactSessionsTopic(e -> e - .typeId(NON_COMPACT_SESSIONS_TOPIC.value()) - .reason(reason)) + .typeId(NON_COMPACT_SESSIONS_TOPIC.value())) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java index 14b9081af9..7e80c669ee 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java @@ -47,7 +47,9 @@ public String format( case NON_COMPACT_SESSIONS_TOPIC: { MqttKafkaResetMqttConnectionExFW ex = extension.nonCompactSessionsTopic(); - result = String.format("%s", asString(ex.reason())); + result = String.format( + "The MQTT sessions Kafka topic is not log compacted. Update the cleanup policy to enable log compaction." + ); break; } } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java index a68ec1c94e..c17b8304da 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java @@ -170,7 +170,6 @@ public class MqttKafkaSessionFactory implements MqttKafkaStreamFactory public static final int MQTT_NOT_AUTHORIZED = 0x87; public static final int MQTT_IMPLEMENTATION_SPECIFIC_ERROR = 0x83; public static final String MQTT_INVALID_SESSION_TIMEOUT_REASON = "Invalid session expiry interval"; - public static final String16FW MQTT_NON_COMPACT_SESSIONS_TOPIC = new String16FW("The Sessions Kafka topic is non-compacted"); private static final KafkaConfigFW CONFIG_COMPACT_CLEANUP_POLICY = new KafkaConfigFW.Builder() .wrap(new UnsafeBuffer(new byte[25]), 0, 25) .name("cleanup.policy") @@ -3469,7 +3468,7 @@ protected void onKafkaBegin( .build(); delegate.doMqttWindow(authorization, traceId, 0, 0, 0); delegate.doMqttReset(traceId, mqttResetEx); - events.onMqttConnectionReset(traceId, routedId, MQTT_NON_COMPACT_SESSIONS_TOPIC); + events.onMqttConnectionReset(traceId, routedId); doKafkaAbort(traceId, authorization); break onKafkaBegin; } diff --git a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl index 5b5cd547f2..c0c8720469 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl +++ b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl @@ -40,7 +40,6 @@ scope mqtt_kafka struct MqttKafkaResetMqttConnectionEx extends core::stream::Extension { - string16 reason; } union MqttKafkaEventEx switch (MqttKafkaEventType) diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml index 4d2bef19db..5065c5789c 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.kafka0 id: binding.mqtt.kafka.non.compact.sessions.topic name: BINDING_MQTT_KAFKA_NON_COMPACT_SESSIONS_TOPIC - message: The Sessions Kafka topic is non-compacted + message: The MQTT sessions Kafka topic is not log compacted. Update the cleanup policy to enable log compaction. bindings: mqtt0: type: mqtt-kafka From f3ccc936e692cf4b085d735a28bb161bf91309e3 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 11:05:19 -0400 Subject: [PATCH 14/28] update model validation event messages --- .../model/avro/internal/AvroModelEventFormatter.java | 6 +++--- .../model/core/internal/CoreModelEventFormatter.java | 5 ++++- .../model/json/internal/JsonModelEventFormatter.java | 2 +- .../protobuf/internal/ProtobufModelEventFormatter.java | 2 +- .../io/aklivity/zilla/specs/model/avro/config/event.yaml | 2 +- .../io/aklivity/zilla/specs/model/core/config/event.yaml | 2 +- .../io/aklivity/zilla/specs/model/json/config/event.yaml | 2 +- .../aklivity/zilla/specs/model/protobuf/config/event.yaml | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java index 45727075e6..1c65b2bf08 100644 --- a/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java +++ b/runtime/model-avro/src/main/java/io/aklivity/zilla/runtime/model/avro/internal/AvroModelEventFormatter.java @@ -26,7 +26,7 @@ public final class AvroModelEventFormatter implements EventFormatterSpi { private final EventFW eventRO = new EventFW(); - private final AvroModelEventExFW jsonModelEventExFW = new AvroModelEventExFW(); + private final AvroModelEventExFW avroModelEventExFW = new AvroModelEventExFW(); AvroModelEventFormatter( Configuration config) @@ -39,7 +39,7 @@ public String format( int length) { final EventFW event = eventRO.wrap(buffer, index, index + length); - final AvroModelEventExFW extension = jsonModelEventExFW + final AvroModelEventExFW extension = avroModelEventExFW .wrap(event.extension().buffer(), event.extension().offset(), event.extension().limit()); String result = null; switch (extension.kind()) @@ -47,7 +47,7 @@ public String format( case VALIDATION_FAILED: { AvroModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format("%s", asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java index 0a4b2f0b32..6ca60dbce5 100644 --- a/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java +++ b/runtime/model-core/src/main/java/io/aklivity/zilla/runtime/model/core/internal/CoreModelEventFormatter.java @@ -47,7 +47,10 @@ public String format( case VALIDATION_FAILED: { CoreModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format("%s", asString(ex.error())); + result = String.format( + "A message payload failed validation. A field was not the expected type (%s).", + asString(ex.error()) + ); break; } } diff --git a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java index e831a8ad2f..a6ad7a690c 100644 --- a/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java +++ b/runtime/model-json/src/main/java/io/aklivity/zilla/runtime/model/json/internal/JsonModelEventFormatter.java @@ -47,7 +47,7 @@ public String format( case VALIDATION_FAILED: { JsonModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format("%s", asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java index bc3cf37ba7..259b294486 100644 --- a/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java +++ b/runtime/model-protobuf/src/main/java/io/aklivity/zilla/runtime/model/protobuf/internal/ProtobufModelEventFormatter.java @@ -47,7 +47,7 @@ public String format( case VALIDATION_FAILED: { ProtobufModelValidationFailedExFW ex = extension.validationFailed(); - result = String.format("%s", asString(ex.error())); + result = String.format("A message payload failed validation. %s.", asString(ex.error())); break; } } diff --git a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml index e8034247fa..56cb116f69 100644 --- a/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml +++ b/specs/model-avro.spec/src/main/scripts/io/aklivity/zilla/specs/model/avro/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: model.avro.validation.failed name: MODEL_AVRO_VALIDATION_FAILED - message: java.io.EOFException + message: A message payload failed validation. java.io.EOFException. catalogs: test0: type: test diff --git a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml index 170b977115..049ad1f8da 100644 --- a/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml +++ b/specs/model-core.spec/src/main/scripts/io/aklivity/zilla/specs/model/core/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: model.core.validation.failed name: MODEL_CORE_VALIDATION_FAILED - message: string + message: A message payload failed validation. A field was not the expected type (string). bindings: net0: kind: server diff --git a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml index aca649b07c..92b2894c51 100644 --- a/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml +++ b/specs/model-json.spec/src/main/scripts/io/aklivity/zilla/specs/model/json/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: model.json.validation.failed name: MODEL_JSON_VALIDATION_FAILED - message: "[1,10][/id] The value must be of string type, but actual type is integer." + message: A message payload failed validation. [1,10][/id] The value must be of string type, but actual type is integer. catalogs: test0: type: test diff --git a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml index 3f55e8a7cc..8eb83d4407 100644 --- a/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml +++ b/specs/model-protobuf.spec/src/main/scripts/io/aklivity/zilla/specs/model/protobuf/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: model.protobuf.validation.failed name: MODEL_PROTOBUF_VALIDATION_FAILED - message: "Cannot find field: date in message example" + message: "A message payload failed validation. Cannot find field: date in message example." catalogs: test0: type: test From c45effea200e6294e5e02269112487da6e620ae2 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 11:13:01 -0400 Subject: [PATCH 15/28] update jwt guard event message --- .../zilla/runtime/guard/jwt/internal/JwtEventFormatter.java | 2 +- .../scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java index 927c3927bf..c90d66f130 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java @@ -47,7 +47,7 @@ public String format( case AUTHORIZATION_FAILED: { JwtAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format("%s", identity(ex.identity())); + result = String.format("No active session found for token identity (%s).", identity(ex.identity())); break; } } diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml index 1e4b518dc0..afe098dc6b 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: guard.jwt.authorization.failed name: GUARD_JWT_AUTHORIZATION_FAILED - message: user + message: No active session found for token identity (user). guards: jwt0: type: jwt From 74af1f5e5ef8d98f271613bdf9cb669997fd6f9a Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 11:19:52 -0400 Subject: [PATCH 16/28] update catalog filesystem event message --- .../aklivity/zilla/specs/catalog/filesystem/config/event.yaml | 2 +- .../catalog/filesystem/internal/FilesystemEventFormatter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml b/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml index 34625b0f02..ff3c57fe7f 100644 --- a/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml +++ b/incubator/catalog-filesystem.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/filesystem/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.catalog0 id: catalog.filesystem.file.not.found name: CATALOG_FILESYSTEM_FILE_NOT_FOUND - message: asyncapi/kafka.yaml + message: Unable to find file at (asyncapi/kafka.yaml) on the host filesystem. catalogs: catalog0: type: filesystem diff --git a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java index 8f1f75d51e..527bde24d8 100644 --- a/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java +++ b/incubator/catalog-filesystem/src/main/java/io/aklivity/zilla/runtime/catalog/filesystem/internal/FilesystemEventFormatter.java @@ -47,7 +47,7 @@ public String format( case FILE_NOT_FOUND: { FilesystemFileNotFoundExFW ex = extension.fileNotFound(); - result = String.format("%s", asString(ex.location())); + result = String.format("Unable to find file at (%s) on the host filesystem.", asString(ex.location())); break; } } From d11f4416e25f4bf17e7af5a4fcd56221fb5af1b0 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 11:45:20 -0400 Subject: [PATCH 17/28] Add generic tls error message --- .../binding/tls/internal/TlsEventFormatter.java | 10 +++++----- .../zilla/specs/binding/tls/config/client.event.yaml | 2 +- .../tls/config/server.event.handshake.failed.yaml | 2 +- .../binding/tls/config/server.event.tls.failed.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java index 6a11d31c22..ff6cd8ab9f 100644 --- a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java +++ b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java @@ -45,27 +45,27 @@ public String format( { case TLS_FAILED: { - result = ""; + result = "There was a generic error detected by an SSL subsystem."; break; } case TLS_PROTOCOL_REJECTED: { - result = ""; + result = "There was an error in the operation of the SSL protocol."; break; } case TLS_KEY_REJECTED: { - result = ""; + result = "Bad SSL key due to misconfiguration of the server or client SSL certificate and private key."; break; } case TLS_PEER_NOT_VERIFIED: { - result = ""; + result = "The peer's identity was not able to identify itself."; break; } case TLS_HANDSHAKE_FAILED: { - result = ""; + result = "The client and server could not negotiate the desired level of security."; break; } } diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml index 8f5ba26a93..3476b91ec5 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/client.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.app0 id: binding.tls.handshake.failed name: BINDING_TLS_HANDSHAKE_FAILED - message: "" + message: The client and server could not negotiate the desired level of security. vaults: client: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml index 50a4b902d1..8898502229 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.handshake.failed.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.tls.handshake.failed name: BINDING_TLS_HANDSHAKE_FAILED - message: "" + message: The client and server could not negotiate the desired level of security. vaults: server: type: filesystem diff --git a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml index 023cb171bf..7b8ea44799 100644 --- a/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml +++ b/specs/binding-tls.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tls/config/server.event.tls.failed.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.tls.tls.failed name: BINDING_TLS_TLS_FAILED - message: "" + message: There was a generic error detected by an SSL subsystem. vaults: server: type: filesystem From 0d122ac81d2c537d1080fce6dc5b92d12247f079 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 11:45:36 -0400 Subject: [PATCH 18/28] update tcp event message --- .../zilla/runtime/binding/tcp/internal/TcpEventFormatter.java | 2 +- .../aklivity/zilla/specs/binding/tcp/config/client.event.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java index 188a0675ec..8ac83a0afe 100644 --- a/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java +++ b/runtime/binding-tcp/src/main/java/io/aklivity/zilla/runtime/binding/tcp/internal/TcpEventFormatter.java @@ -48,7 +48,7 @@ public String format( case DNS_FAILED: { final TcpDnsFailedExFW ex = extension.dnsFailed(); - result = String.format("%s", asString(ex.address())); + result = String.format("Unable to resolve host dns for address (%s).", asString(ex.address())); break; } } diff --git a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml index e729f02b62..1e3272f5d3 100644 --- a/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml +++ b/specs/binding-tcp.spec/src/main/scripts/io/aklivity/zilla/specs/binding/tcp/config/client.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.app0 id: binding.tcp.dns.failed name: BINDING_TCP_DNS_FAILED - message: localhost + message: Unable to resolve host dns for address (localhost). bindings: app0: type: tcp From 7bdd8e3c40ea573403841a449913741fdba7507d Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 11:46:03 -0400 Subject: [PATCH 19/28] add context to mqtt client connected message --- .../zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java | 2 +- .../zilla/specs/binding/mqtt/config/server.log.event.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java index 5768197707..7c7a97d4c4 100644 --- a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java +++ b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java @@ -48,7 +48,7 @@ public String format( case CLIENT_CONNECTED: { MqttClientConnectedExFW ex = extension.clientConnected(); - result = String.format("%s %s", identity(ex.identity()), asString(ex.clientId())); + result = String.format("Session authorization (%s) was successful for client id (%s).", identity(ex.identity()), asString(ex.clientId())); break; } } diff --git a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml index c94d5ef5f0..d321882e7e 100644 --- a/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml +++ b/specs/binding-mqtt.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/config/server.log.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.mqtt.client.connected name: BINDING_MQTT_CLIENT_CONNECTED - message: "- client" + message: Session authorization (-) was successful for client id (client). bindings: net0: type: mqtt From a23579b985ea59da2573a49cf76ac1700d9e894a Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 12:37:24 -0400 Subject: [PATCH 20/28] update kafka and http message formatting --- .../binding/http/internal/HttpEventFormatter.java | 2 +- .../binding/kafka/internal/KafkaEventFormatter.java | 10 +++++----- .../specs/binding/http/config/v1.1/server.event.yaml | 2 +- .../specs/binding/http/config/v2/server.event.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java index abacfa256d..9ffb72a313 100644 --- a/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java +++ b/runtime/binding-http/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/HttpEventFormatter.java @@ -48,7 +48,7 @@ public String format( case REQUEST_ACCEPTED: { HttpRequestAcceptedExFW ex = extension.requestAccepted(); - result = String.format("%s %s %s %s %s", identity(ex.identity()), asString(ex.scheme()), asString(ex.method()), + result = String.format("%s %s %s://%s%s", identity(ex.identity()), asString(ex.method()), asString(ex.scheme()), asString(ex.authority()), asString(ex.path())); break; } diff --git a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java index b6fdda29dc..4e6bd691ff 100644 --- a/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java +++ b/runtime/binding-kafka/src/main/java/io/aklivity/zilla/runtime/binding/kafka/internal/KafkaEventFormatter.java @@ -49,7 +49,7 @@ public String format( case AUTHORIZATION_FAILED: { KafkaAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format("%s", identity(ex.identity())); + result = String.format("Unable to authenticate client with identity (%s).", asString(ex.identity())); break; } case API_VERSION_REJECTED: @@ -61,10 +61,10 @@ public String format( return result; } - private static String identity( - StringFW identity) + private static String asString( + StringFW stringFW) { - int length = identity.length(); - return length <= 0 ? "-" : identity.asString(); + String s = stringFW.asString(); + return s == null ? "" : s; } } diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml index 9bb183a10e..acaf62c8d7 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v1.1/server.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.http.request.accepted name: BINDING_HTTP_REQUEST_ACCEPTED - message: "- http GET localhost:8080 /" + message: "- GET http://localhost:8080/" bindings: net0: type: http diff --git a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml index b2d5d70f60..78534a2dc1 100644 --- a/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml +++ b/specs/binding-http.spec/src/main/scripts/io/aklivity/zilla/specs/binding/http/config/v2/server.event.yaml @@ -25,7 +25,7 @@ telemetry: - qname: test.net0 id: binding.http.request.accepted name: BINDING_HTTP_REQUEST_ACCEPTED - message: "- http GET localhost:8080 /" + message: "- GET http://localhost:8080/" bindings: net0: type: http From 4086ca45aec3bcd97daa5ec100a360f81869f4e8 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 12:52:53 -0400 Subject: [PATCH 21/28] update apicurio artifact fetch messages --- .../internal/ApicurioEventFormatter.java | 23 ++++++++++++++----- .../artifact/global/id/retry/zilla.yaml | 6 ++--- .../id/subject/version/failed/zilla.yaml | 6 +---- .../id/subject/version/retry/zilla.yaml | 10 ++++---- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java index 4cbd88cac3..06da0a0b01 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java @@ -51,33 +51,44 @@ public String format( case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: { ApicurioUnretrievableArtifactSubjectVersionExFW ex = extension.unretrievableArtifactSubjectVersion(); - result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); + result = String.format( + "Unable to fetch artifact for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: { ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW ex = extension .unretrievableArtifactSubjectVersionStaleArtifact(); - result = String.format("%s (%s) | stale artifactId (%d)", asString(ex.subject()), - asString(ex.version()), ex.artifactId()); + result = String.format( + "Unable to fetch artifact for subject %s with version %s; using stale artifact with id %d.", + asString(ex.subject()), + asString(ex.version()), + ex.artifactId() + ); break; } case UNRETRIEVABLE_ARTIFACT_ID: { ApicurioUnretrievableArtifactIdExFW ex = extension.unretrievableArtifactId(); - result = String.format("%d", ex.artifactId()); + result = String.format("Unable to fetch artifact id %d.", ex.artifactId()); break; } case RETRIEVED_ARTIFACT_SUBJECT_VERSION: { ApicurioRetrievableArtifactSubjectVersionExFW ex = extension.retrievableArtifactSubjectVersion(); - result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); + result = String.format("Successfully fetched artifact for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case RETRIEVED_ARTIFACT_ID: { ApicurioRetrievableArtifactIdExFW ex = extension.retrievableArtifactId(); - result = String.format("$d", ex.artifactId()); + result = String.format("Successfully fetched artifact id %d.", ex.artifactId()); break; } } diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml index 9f998b2728..917f43b918 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml @@ -24,11 +24,11 @@ telemetry: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.id name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_ID - message: 1 + message: Unable to fetch artifact id 1. - qname: test.catalog0 id: catalog.apicurio.retrievable.artifact.id - name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_ID - message: 1 + name: CATALOG_APICURIO_RETRIEVABLE_ARTIFACT_ID + message: Successfully fetched artifact id 1. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml index a840bad739..ef7ad346df 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/failed/zilla.yaml @@ -21,14 +21,10 @@ telemetry: type: test options: events: - - qname: test.catalog0 - id: catalog.apicurio.remote.access.rejected - name: CATALOG_APICURIO_REMOTE_ACCESS_REJECTED - message: GET http://localhost:8081/apis/registry/v2/ids/globalIds/1 0 - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION - message: artifactId latest + message: Unable to fetch artifact for subject artifactId with version latest. catalogs: catalog0: type: apicurio diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml index 71cf54bcd7..386ad1f5d8 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml @@ -24,15 +24,15 @@ telemetry: - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION - message: artifactId latest + message: Unable to fetch artifact for subject artifactId with version latest. - qname: test.catalog0 id: catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact - name: UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT - message: artifactId (latest) | stale artifactId (1) + name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT + message: Unable to fetch artifact for subject artifactId with version latest; using stale artifact with id 1. - qname: test.catalog0 id: catalog.apicurio.retrievable.artifact.subject.version - name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_SUBJECT_VERSION - message: artifactId latest + name: CATALOG_APICURIO_RETRIEVABLE_ARTIFACT_SUBJECT_VERSION + message: Successfully fetched artifact for subject artifactId with version latest. catalogs: catalog0: type: apicurio From 369e109d24c220fce8cc0b56d3ab7eb4db62edf9 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 13:29:59 -0400 Subject: [PATCH 22/28] update karapace schema registry message formatting --- .../internal/ApicurioEventContext.java | 12 ++++----- .../internal/ApicurioEventFormatter.java | 8 +++--- .../internal/KarapaceEventContext.java | 12 ++++----- .../internal/KarapaceEventFormatter.java | 27 +++++++++++++------ .../resources/META-INF/zilla/apicurio.idl | 8 +++--- .../artifact/global/id/retry/zilla.yaml | 4 +-- .../id/subject/version/retry/zilla.yaml | 4 +-- .../resources/META-INF/zilla/karapace.idl | 8 +++--- .../config/resolve/schema/id/retry/zilla.yaml | 6 ++--- .../resolve/subject/version/retry/zilla.yaml | 12 ++++----- .../config/unretrievable/schema/id/zilla.yaml | 2 +- .../schema/subject/version/zilla.yaml | 4 +-- 12 files changed, 59 insertions(+), 48 deletions(-) diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java index 85553059b8..91f2f3be23 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventContext.java @@ -44,7 +44,7 @@ public class ApicurioEventContext private final int staleArtifactID; private final int unretrievableArtifactId; private final int retrievableArtifactSubjectVersionId; - private final int retrievableArtifactId; + private final int retrievedArtifactId; private final MessageConsumer eventWriter; private final Clock clock; @@ -57,8 +57,8 @@ public ApicurioEventContext( this.staleArtifactID = context.supplyEventId("catalog.apicurio.unretrievable.artifact.subject.version.stale.artifact"); this.unretrievableArtifactId = context.supplyEventId("catalog.apicurio.unretrievable.artifact.id"); this.retrievableArtifactSubjectVersionId = context.supplyEventId( - "catalog.apicurio.retrievable.artifact.subject.version"); - this.retrievableArtifactId = context.supplyEventId("catalog.apicurio.retrievable.artifact.id"); + "catalog.apicurio.retrieved.artifact.subject.version"); + this.retrievedArtifactId = context.supplyEventId("catalog.apicurio.retrieved.artifact.id"); this.eventWriter = context.supplyEventWriter(); this.clock = context.clock(); } @@ -142,7 +142,7 @@ public void onRetrievableArtifactSubjectVersion( { ApicurioEventExFW extension = apicurioEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableArtifactSubjectVersion(e -> e + .retrievedArtifactSubjectVersion(e -> e .typeId(RETRIEVED_ARTIFACT_SUBJECT_VERSION.value()) .subject(subject) .version(version) @@ -165,14 +165,14 @@ public void onRetrievableArtifactId( { ApicurioEventExFW extension = apicurioEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableArtifactId(e -> e + .retrievedArtifactId(e -> e .typeId(RETRIEVED_ARTIFACT_ID.value()) .artifactId(artifactId) ) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) - .id(retrievableArtifactId) + .id(retrievedArtifactId) .timestamp(clock.millis()) .traceId(0L) .namespacedId(catalogId) diff --git a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java index 06da0a0b01..319d9d1d95 100644 --- a/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java +++ b/runtime/catalog-apicurio/src/main/java/io/aklivity/zilla/runtime/catalog/apicurio/internal/ApicurioEventFormatter.java @@ -18,8 +18,8 @@ import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.StringFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioEventExFW; -import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievableArtifactIdExFW; -import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievableArtifactSubjectVersionExFW; +import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievedArtifactIdExFW; +import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioRetrievedArtifactSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactIdExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.apicurio.internal.types.event.ApicurioUnretrievableArtifactSubjectVersionStaleArtifactExFW; @@ -78,7 +78,7 @@ public String format( } case RETRIEVED_ARTIFACT_SUBJECT_VERSION: { - ApicurioRetrievableArtifactSubjectVersionExFW ex = extension.retrievableArtifactSubjectVersion(); + ApicurioRetrievedArtifactSubjectVersionExFW ex = extension.retrievedArtifactSubjectVersion(); result = String.format("Successfully fetched artifact for subject %s with version %s.", asString(ex.subject()), asString(ex.version()) @@ -87,7 +87,7 @@ public String format( } case RETRIEVED_ARTIFACT_ID: { - ApicurioRetrievableArtifactIdExFW ex = extension.retrievableArtifactId(); + ApicurioRetrievedArtifactIdExFW ex = extension.retrievedArtifactId(); result = String.format("Successfully fetched artifact id %d.", ex.artifactId()); break; } diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java index 74c78934b8..e6cee3bcd5 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventContext.java @@ -44,7 +44,7 @@ public class KarapaceEventContext private final int staleSchemaID; private final int unretrievableSchemaId; private final int retrievableSchemaSubjectVersionId; - private final int retrievableSchemaId; + private final int retrievedSchemaId; private final MessageConsumer eventWriter; private final Clock clock; @@ -55,8 +55,8 @@ public KarapaceEventContext( this.unretrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.unretrievable.schema.subject.version"); this.staleSchemaID = context.supplyEventId("catalog.karapace.unretrievable.schema.subject.version.stale.schema"); this.unretrievableSchemaId = context.supplyEventId("catalog.karapace.unretrievable.schema.id"); - this.retrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.retrievable.schema.subject.version"); - this.retrievableSchemaId = context.supplyEventId("catalog.karapace.retrievable.schema.id"); + this.retrievableSchemaSubjectVersionId = context.supplyEventId("catalog.karapace.retrieved.schema.subject.version"); + this.retrievedSchemaId = context.supplyEventId("catalog.karapace.retrieved.schema.id"); this.eventWriter = context.supplyEventWriter(); this.clock = context.clock(); } @@ -140,7 +140,7 @@ public void onRetrievableSchemaSubjectVersion( { KarapaceEventExFW extension = karapaceEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableSchemaSubjectVersion(e -> e + .retrievedSchemaSubjectVersion(e -> e .typeId(RETRIEVED_SCHEMA_SUBJECT_VERSION.value()) .subject(subject) .version(version) @@ -163,14 +163,14 @@ public void onRetrievableSchemaId( { KarapaceEventExFW extension = karapaceEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) - .retrievableSchemaId(e -> e + .retrievedSchemaId(e -> e .typeId(RETRIEVED_SCHEMA_ID.value()) .schemaId(schemaId) ) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) - .id(retrievableSchemaId) + .id(retrievedSchemaId) .timestamp(clock.millis()) .traceId(0L) .namespacedId(catalogId) diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java index d00d0d8780..1bc1961063 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java @@ -51,33 +51,44 @@ public String format( case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: { KarapaceUnretrievableSchemaSubjectVersionExFW ex = extension.unretrievableSchemaSubjectVersion(); - result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); + result = String.format( + "Unable to fetch schema for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: { KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW ex = extension .unretrievableSchemaSubjectVersionStaleSchema(); - result = String.format("%s %s, using stale schema: %d", asString(ex.subject()), - asString(ex.version()), ex.schemaId()); + result = String.format( + "Unable to fetch schema for subject %s with version %s; using stale schema with id %d.", + asString(ex.subject()), + asString(ex.version()), + ex.schemaId() + ); break; } case UNRETRIEVABLE_SCHEMA_ID: { KarapaceUnretrievableSchemaIdExFW ex = extension.unretrievableSchemaId(); - result = String.format("%d", ex.schemaId()); + result = String.format("Unable to fetch schema id %d.", ex.schemaId()); break; } case RETRIEVED_SCHEMA_SUBJECT_VERSION: { - KarapaceRetrievableSchemaSubjectVersionExFW ex = extension.retrievableSchemaSubjectVersion(); - result = String.format("%s %s", asString(ex.subject()), asString(ex.version())); + KarapaceRetrievableSchemaSubjectVersionExFW ex = extension.retrievedSchemaSubjectVersion(); + result = String.format("Successfully fetched schema for subject %s with version %s.", + asString(ex.subject()), + asString(ex.version()) + ); break; } case RETRIEVED_SCHEMA_ID: { - KarapaceRetrievableSchemaIdExFW ex = extension.retrievableSchemaId(); - result = String.format("%d", ex.schemaId()); + KarapaceRetrievableSchemaIdExFW ex = extension.retrievedSchemaId(); + result = String.format("Successfully fetched schema id %d.", ex.schemaId()); break; } } diff --git a/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl b/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl index 2e19e88727..ca87587f99 100644 --- a/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl +++ b/specs/catalog-apicurio.spec/src/main/resources/META-INF/zilla/apicurio.idl @@ -43,13 +43,13 @@ scope apicurio int32 artifactId; } - struct ApicurioRetrievableArtifactSubjectVersionEx extends core::stream::Extension + struct ApicurioRetrievedArtifactSubjectVersionEx extends core::stream::Extension { string8 subject; string8 version; } - struct ApicurioRetrievableArtifactIdEx extends core::stream::Extension + struct ApicurioRetrievedArtifactIdEx extends core::stream::Extension { int32 artifactId; } @@ -59,8 +59,8 @@ scope apicurio case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION: ApicurioUnretrievableArtifactSubjectVersionEx unretrievableArtifactSubjectVersion; case UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT: ApicurioUnretrievableArtifactSubjectVersionStaleArtifactEx unretrievableArtifactSubjectVersionStaleArtifact; case UNRETRIEVABLE_ARTIFACT_ID: ApicurioUnretrievableArtifactIdEx unretrievableArtifactId; - case RETRIEVED_ARTIFACT_SUBJECT_VERSION: ApicurioRetrievableArtifactSubjectVersionEx retrievableArtifactSubjectVersion; - case RETRIEVED_ARTIFACT_ID: ApicurioRetrievableArtifactIdEx retrievableArtifactId; + case RETRIEVED_ARTIFACT_SUBJECT_VERSION: ApicurioRetrievedArtifactSubjectVersionEx retrievedArtifactSubjectVersion; + case RETRIEVED_ARTIFACT_ID: ApicurioRetrievedArtifactIdEx retrievedArtifactId; } } } diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml index 917f43b918..b4eaf2d073 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/global/id/retry/zilla.yaml @@ -26,8 +26,8 @@ telemetry: name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_ID message: Unable to fetch artifact id 1. - qname: test.catalog0 - id: catalog.apicurio.retrievable.artifact.id - name: CATALOG_APICURIO_RETRIEVABLE_ARTIFACT_ID + id: catalog.apicurio.retrieved.artifact.id + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_ID message: Successfully fetched artifact id 1. catalogs: catalog0: diff --git a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml index 386ad1f5d8..ca4cad8fae 100644 --- a/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml +++ b/specs/catalog-apicurio.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/apicurio/config/resolve/artifact/id/subject/version/retry/zilla.yaml @@ -30,8 +30,8 @@ telemetry: name: CATALOG_APICURIO_UNRETRIEVABLE_ARTIFACT_SUBJECT_VERSION_STALE_ARTIFACT message: Unable to fetch artifact for subject artifactId with version latest; using stale artifact with id 1. - qname: test.catalog0 - id: catalog.apicurio.retrievable.artifact.subject.version - name: CATALOG_APICURIO_RETRIEVABLE_ARTIFACT_SUBJECT_VERSION + id: catalog.apicurio.retrieved.artifact.subject.version + name: CATALOG_APICURIO_RETRIEVED_ARTIFACT_SUBJECT_VERSION message: Successfully fetched artifact for subject artifactId with version latest. catalogs: catalog0: diff --git a/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl b/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl index e277c81e52..2004aa856d 100644 --- a/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl +++ b/specs/catalog-karapace.spec/src/main/resources/META-INF/zilla/karapace.idl @@ -43,13 +43,13 @@ scope karapace int32 schemaId; } - struct KarapaceRetrievableSchemaSubjectVersionEx extends core::stream::Extension + struct KarapaceRetrievedSchemaSubjectVersionEx extends core::stream::Extension { string8 subject; string8 version; } - struct KarapaceRetrievableSchemaIdEx extends core::stream::Extension + struct KarapaceRetrievedSchemaIdEx extends core::stream::Extension { int32 schemaId; } @@ -59,8 +59,8 @@ scope karapace case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION: KarapaceUnretrievableSchemaSubjectVersionEx unretrievableSchemaSubjectVersion; case UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA: KarapaceUnretrievableSchemaSubjectVersionStaleSchemaEx unretrievableSchemaSubjectVersionStaleSchema; case UNRETRIEVABLE_SCHEMA_ID: KarapaceUnretrievableSchemaIdEx unretrievableSchemaId; - case RETRIEVED_SCHEMA_SUBJECT_VERSION: KarapaceRetrievableSchemaSubjectVersionEx retrievableSchemaSubjectVersion; - case RETRIEVED_SCHEMA_ID: KarapaceRetrievableSchemaIdEx retrievableSchemaId; + case RETRIEVED_SCHEMA_SUBJECT_VERSION: KarapaceRetrievedSchemaSubjectVersionEx retrievedSchemaSubjectVersion; + case RETRIEVED_SCHEMA_ID: KarapaceRetrievedSchemaIdEx retrievedSchemaId; } } } diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml index 18c8b7317a..df433b2e95 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/schema/id/retry/zilla.yaml @@ -24,11 +24,11 @@ telemetry: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID - message: 9 + message: Unable to fetch schema id 9. - qname: test.catalog0 - id: catalog.karapace.retrievable.schema.id + id: catalog.karapace.retrieved.schema.id name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_ID - message: 9 + message: Successfully fetched schema id 9. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml index b425b918d1..f917cdae5a 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/resolve/subject/version/retry/zilla.yaml @@ -23,16 +23,16 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA - message: items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION + message: Unable to fetch schema for subject items-snapshots-value with version latest. - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version.stale.schema - name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA - message: items-snapshots-value latest, USING_STALE_SCHEMA 9 + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION_STALE_SCHEMA + message: Unable to fetch schema for subject items-snapshots-value with version latest; using stale schema with id 9. - qname: test.catalog0 - id: catalog.karapace.retrievable.schema.subject.version + id: catalog.karapace.retrieved.schema.subject.version name: CATALOG_KARAPACE_RETRIEVED_SCHEMA_SUBJECT_VERSION - message: items-snapshots-value latest + message: Successfully fetched schema for subject items-snapshots-value with version latest. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml index c12bc168b9..88f28c49a2 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/id/zilla.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.id name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_ID - message: 1 + message: Unable to fetch schema id 1. catalogs: catalog0: type: karapace diff --git a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml index 2adde1fdc7..28de1a1313 100644 --- a/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml +++ b/specs/catalog-karapace.spec/src/main/scripts/io/aklivity/zilla/specs/catalog/karapace/config/unretrievable/schema/subject/version/zilla.yaml @@ -23,8 +23,8 @@ telemetry: events: - qname: test.catalog0 id: catalog.karapace.unretrievable.schema.subject.version - name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA - message: items-snapshots-value latest + name: CATALOG_KARAPACE_UNRETRIEVABLE_SCHEMA_SUBJECT_VERSION + message: Unable to fetch schema for subject items-snapshots-value with version latest. catalogs: catalog0: type: karapace From 6cd31b3272fc0e3b12363edb57082fbdbdc102ec Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 13:32:43 -0400 Subject: [PATCH 23/28] fix test --- .../zilla/runtime/exporter/stdout/internal/events/EventIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java index 9e7aaced03..c2d49a0075 100644 --- a/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java +++ b/runtime/exporter-stdout/src/test/java/io/aklivity/zilla/runtime/exporter/stdout/internal/events/EventIT.java @@ -63,6 +63,6 @@ public class EventIT public void shouldLogEvents() throws Exception { k3po.finish(); - output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] BINDING_TEST_CONNECTED - test event message\n")); + output.expect(Pattern.compile("test.net0 \\[[^\\]]+\\] BINDING_TEST_CONNECTED test event message\n")); } } From 656b19adfecc15dc8df1a3e807fbdd4754995061 Mon Sep 17 00:00:00 2001 From: AJ Danelz Date: Mon, 3 Jun 2024 14:24:01 -0400 Subject: [PATCH 24/28] Update runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java Co-authored-by: John Fallows --- .../zilla/runtime/binding/tls/internal/TlsEventFormatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java index ff6cd8ab9f..992946d7f6 100644 --- a/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java +++ b/runtime/binding-tls/src/main/java/io/aklivity/zilla/runtime/binding/tls/internal/TlsEventFormatter.java @@ -60,7 +60,7 @@ public String format( } case TLS_PEER_NOT_VERIFIED: { - result = "The peer's identity was not able to identify itself."; + result = "The peer's identity could not be verified."; break; } case TLS_HANDSHAKE_FAILED: From 187bd0e64dda2259bc46254780084494741d9a2f Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 15:08:36 -0400 Subject: [PATCH 25/28] Improve jwt message with added reason --- .../guard/jwt/internal/JwtEventContext.java | 4 +++- .../guard/jwt/internal/JwtEventFormatter.java | 13 ++++++++----- .../guard/jwt/internal/JwtGuardHandler.java | 16 ++++++++++++---- .../src/main/resources/META-INF/zilla/jwt.idl | 1 + .../zilla/specs/guard/jwt/config/event.yaml | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java index d5c2ec1d04..a42847a34f 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventContext.java @@ -52,13 +52,15 @@ public JwtEventContext( public void authorizationFailed( long traceId, long bindingId, - String identity) + String identity, + String reason) { JwtEventExFW extension = jwtEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .authorizationFailed(e -> e .typeId(AUTHORIZATION_FAILED.value()) .identity(identity) + .reason(reason) ) .build(); EventFW event = eventRW diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java index c90d66f130..32a1c11875 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtEventFormatter.java @@ -47,17 +47,20 @@ public String format( case AUTHORIZATION_FAILED: { JwtAuthorizationFailedExFW ex = extension.authorizationFailed(); - result = String.format("No active session found for token identity (%s).", identity(ex.identity())); + result = String.format("JWT token authorization failed for identity (%s). %s", + asString(ex.identity()), + asString(ex.reason()) + ); break; } } return result; } - private static String identity( - StringFW identity) + private static String asString( + StringFW stringFW) { - int length = identity.length(); - return length <= 0 ? "-" : identity.asString(); + String s = stringFW.asString(); + return s == null ? "" : s; } } diff --git a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java index d166b336c6..50ec6342bb 100644 --- a/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java +++ b/runtime/guard-jwt/src/main/java/io/aklivity/zilla/runtime/guard/jwt/internal/JwtGuardHandler.java @@ -128,6 +128,7 @@ public long reauthorize( { JwtSession session = null; String subject = null; + String reason = ""; authorize: try @@ -142,6 +143,7 @@ public long reauthorize( key == null || !Objects.equals(alg, key.getAlgorithm())) { + reason = "Invalid alg or key."; break authorize; } @@ -149,6 +151,7 @@ public long reauthorize( signature.setKey(key.getKey()); if (!signature.verifySignature()) { + reason = "Unable to verify key signature."; break authorize; } @@ -162,10 +165,15 @@ public long reauthorize( long now = Instant.now().toEpochMilli(); if (notBefore != null && now < notBefore.getValueInMillis() || - notAfter != null && now > notAfter.getValueInMillis() || - issuer == null || !issuer.equals(this.issuer) || + notAfter != null && now > notAfter.getValueInMillis()) + { + reason = "Token is expired."; + break authorize; + } + if (issuer == null || !issuer.equals(this.issuer) || audience == null || !audience.contains(this.audience)) { + reason = "Invalid issuer or audience."; break authorize; } @@ -191,11 +199,11 @@ public long reauthorize( } catch (JoseException | InvalidJwtException | MalformedClaimException ex) { - // not authorized + reason = ex.getMessage(); } if (session == null) { - event.authorizationFailed(traceId, bindingId, subject); + event.authorizationFailed(traceId, bindingId, subject, reason); } return session != null ? session.authorized : NOT_AUTHORIZED; } diff --git a/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl b/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl index 937f7f2cf7..81049bbab9 100644 --- a/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl +++ b/specs/guard-jwt.spec/src/main/resources/META-INF/zilla/jwt.idl @@ -24,6 +24,7 @@ scope jwt struct JwtAuthorizationFailedEx extends core::stream::Extension { string8 identity; + string16 reason; } union JwtEventEx switch (JwtEventType) diff --git a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml index afe098dc6b..e70027751e 100644 --- a/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml +++ b/specs/guard-jwt.spec/src/main/scripts/io/aklivity/zilla/specs/guard/jwt/config/event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.net0 id: guard.jwt.authorization.failed name: GUARD_JWT_AUTHORIZATION_FAILED - message: No active session found for token identity (user). + message: JWT token authorization failed for identity (user). Token is expired. guards: jwt0: type: jwt From 140f62868990b266c1bb2cafbed0a6148b0a5e67 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 15:08:57 -0400 Subject: [PATCH 26/28] rename --- .../catalog/karapace/internal/KarapaceEventFormatter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java index 1bc1961063..2447bcb963 100644 --- a/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java +++ b/runtime/catalog-karapace/src/main/java/io/aklivity/zilla/runtime/catalog/karapace/internal/KarapaceEventFormatter.java @@ -19,8 +19,8 @@ import io.aklivity.zilla.runtime.catalog.karapace.internal.types.StringFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.EventFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceEventExFW; -import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievableSchemaIdExFW; -import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievableSchemaSubjectVersionExFW; +import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievedSchemaIdExFW; +import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceRetrievedSchemaSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaIdExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaSubjectVersionExFW; import io.aklivity.zilla.runtime.catalog.karapace.internal.types.event.KarapaceUnretrievableSchemaSubjectVersionStaleSchemaExFW; @@ -78,7 +78,7 @@ public String format( } case RETRIEVED_SCHEMA_SUBJECT_VERSION: { - KarapaceRetrievableSchemaSubjectVersionExFW ex = extension.retrievedSchemaSubjectVersion(); + KarapaceRetrievedSchemaSubjectVersionExFW ex = extension.retrievedSchemaSubjectVersion(); result = String.format("Successfully fetched schema for subject %s with version %s.", asString(ex.subject()), asString(ex.version()) @@ -87,7 +87,7 @@ public String format( } case RETRIEVED_SCHEMA_ID: { - KarapaceRetrievableSchemaIdExFW ex = extension.retrievedSchemaId(); + KarapaceRetrievedSchemaIdExFW ex = extension.retrievedSchemaId(); result = String.format("Successfully fetched schema id %d.", ex.schemaId()); break; } From 6377a8aebc29a29102f2a37d321461adf8b2c2cd Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 15:09:42 -0400 Subject: [PATCH 27/28] improve mqtt session topic compated event message --- .../binding/mqtt/kafka/internal/MqttKafkaEventContext.java | 7 +++++-- .../mqtt/kafka/internal/MqttKafkaEventFormatter.java | 7 ++++--- .../kafka/internal/stream/MqttKafkaSessionFactory.java | 2 +- .../runtime/binding/mqtt/internal/MqttEventFormatter.java | 5 ++++- .../src/main/resources/META-INF/zilla/mqtt_kafka.idl | 5 +++-- .../specs/binding/mqtt/kafka/config/proxy.log.event.yaml | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java index caab30d7d7..28c595dcd0 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventContext.java @@ -22,6 +22,7 @@ import org.agrona.concurrent.AtomicBuffer; import org.agrona.concurrent.UnsafeBuffer; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.EventFW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaEventExFW; import io.aklivity.zilla.runtime.engine.EngineContext; @@ -51,12 +52,14 @@ public MqttKafkaEventContext( public void onMqttConnectionReset( long traceId, - long bindingId) + long bindingId, + String16FW topic) { MqttKafkaEventExFW extension = mqttKafkaEventExRW .wrap(extensionBuffer, 0, extensionBuffer.capacity()) .nonCompactSessionsTopic(e -> e - .typeId(NON_COMPACT_SESSIONS_TOPIC.value())) + .typeId(NON_COMPACT_SESSIONS_TOPIC.value()) + .topic(topic)) .build(); EventFW event = eventRW .wrap(eventBuffer, 0, eventBuffer.capacity()) diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java index 7e80c669ee..d8163664fd 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/MqttKafkaEventFormatter.java @@ -19,7 +19,7 @@ import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.String16FW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.EventFW; import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaEventExFW; -import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaResetMqttConnectionExFW; +import io.aklivity.zilla.runtime.binding.mqtt.kafka.internal.types.event.MqttKafkaNonCompactSessionsTopicExFW; import io.aklivity.zilla.runtime.engine.Configuration; import io.aklivity.zilla.runtime.engine.event.EventFormatterSpi; @@ -46,9 +46,10 @@ public String format( { case NON_COMPACT_SESSIONS_TOPIC: { - MqttKafkaResetMqttConnectionExFW ex = extension.nonCompactSessionsTopic(); + MqttKafkaNonCompactSessionsTopicExFW ex = extension.nonCompactSessionsTopic(); result = String.format( - "The MQTT sessions Kafka topic is not log compacted. Update the cleanup policy to enable log compaction." + "The sessions topic (%s) is not log compacted. Update the cleanup policy to enable log compaction.", + asString(ex.topic()) ); break; } diff --git a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java index c17b8304da..ff574996ea 100644 --- a/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java +++ b/runtime/binding-mqtt-kafka/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/kafka/internal/stream/MqttKafkaSessionFactory.java @@ -3468,7 +3468,7 @@ protected void onKafkaBegin( .build(); delegate.doMqttWindow(authorization, traceId, 0, 0, 0); delegate.doMqttReset(traceId, mqttResetEx); - events.onMqttConnectionReset(traceId, routedId); + events.onMqttConnectionReset(traceId, routedId, delegate.sessionsTopic); doKafkaAbort(traceId, authorization); break onKafkaBegin; } diff --git a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java index 7c7a97d4c4..a1447176d7 100644 --- a/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java +++ b/runtime/binding-mqtt/src/main/java/io/aklivity/zilla/runtime/binding/mqtt/internal/MqttEventFormatter.java @@ -48,7 +48,10 @@ public String format( case CLIENT_CONNECTED: { MqttClientConnectedExFW ex = extension.clientConnected(); - result = String.format("Session authorization (%s) was successful for client id (%s).", identity(ex.identity()), asString(ex.clientId())); + result = String.format("Session authorization (%s) was successful for client id (%s).", + identity(ex.identity()), + asString(ex.clientId()) + ); break; } } diff --git a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl index c0c8720469..ac11492a6b 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl +++ b/specs/binding-mqtt-kafka.spec/src/main/resources/META-INF/zilla/mqtt_kafka.idl @@ -38,13 +38,14 @@ scope mqtt_kafka NON_COMPACT_SESSIONS_TOPIC (1) } - struct MqttKafkaResetMqttConnectionEx extends core::stream::Extension + struct MqttKafkaNonCompactSessionsTopicEx extends core::stream::Extension { + string16 topic; } union MqttKafkaEventEx switch (MqttKafkaEventType) { - case NON_COMPACT_SESSIONS_TOPIC: MqttKafkaResetMqttConnectionEx nonCompactSessionsTopic; + case NON_COMPACT_SESSIONS_TOPIC: MqttKafkaNonCompactSessionsTopicEx nonCompactSessionsTopic; } } } \ No newline at end of file diff --git a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml index 5065c5789c..a7c0e1a685 100644 --- a/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml +++ b/specs/binding-mqtt-kafka.spec/src/main/scripts/io/aklivity/zilla/specs/binding/mqtt/kafka/config/proxy.log.event.yaml @@ -24,7 +24,7 @@ telemetry: - qname: test.kafka0 id: binding.mqtt.kafka.non.compact.sessions.topic name: BINDING_MQTT_KAFKA_NON_COMPACT_SESSIONS_TOPIC - message: The MQTT sessions Kafka topic is not log compacted. Update the cleanup policy to enable log compaction. + message: The sessions topic (mqtt-sessions) is not log compacted. Update the cleanup policy to enable log compaction. bindings: mqtt0: type: mqtt-kafka From 0b38f7abaee86db9a5c72c2793b815396db37757 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 16:24:41 -0400 Subject: [PATCH 28/28] update code coverage for guard-jwt project to 0.97 --- runtime/guard-jwt/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/guard-jwt/pom.xml b/runtime/guard-jwt/pom.xml index 00df1533ea..876894d746 100644 --- a/runtime/guard-jwt/pom.xml +++ b/runtime/guard-jwt/pom.xml @@ -26,7 +26,7 @@ 11 11 - 0.98 + 0.97 0