Skip to content

Commit

Permalink
move event names out of format
Browse files Browse the repository at this point in the history
  • Loading branch information
vordimous committed May 23, 2024
1 parent 5ef2595 commit c20616b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c20616b

Please sign in to comment.