From 4086ca45aec3bcd97daa5ec100a360f81869f4e8 Mon Sep 17 00:00:00 2001 From: AJ Date: Mon, 3 Jun 2024 12:52:53 -0400 Subject: [PATCH] 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