From 0165721d02441a0d6ac6d3a9a0b51bf739b80b9e Mon Sep 17 00:00:00 2001 From: oyershov Date: Thu, 4 Mar 2021 13:52:21 +0200 Subject: [PATCH] AGILE-954: Change endpoints map value type. --- 0009/0009-ep-connected.avsc | 20 +++- 0009/0009-ep-disconnected.avsc | 20 +++- 0009/README.md | 168 ++++++++++++++++++++------------- 3 files changed, 136 insertions(+), 72 deletions(-) diff --git a/0009/0009-ep-connected.avsc b/0009/0009-ep-connected.avsc index b1f1ce9..1d19bd7 100644 --- a/0009/0009-ep-connected.avsc +++ b/0009/0009-ep-connected.avsc @@ -25,7 +25,23 @@ "doc":"Connected endpoints' IDs map to their application version names", "type":{ "type":"map", - "values":"string" + "values":{ + "type": "record", + "name": "EndpointMeta", + "doc":"Endpoint metadata.", + "fields":[ + { + "name":"appVersion", + "type":"string", + "doc":"Identifier of the endpoint application" + }, + { + "name":"tenantId", + "type":"string", + "doc":"Identifier of the endpoint tenant" + } + ] + } } }, { @@ -34,4 +50,4 @@ "doc":"Identifier of the service replica that generated the event" } ] -} +} \ No newline at end of file diff --git a/0009/0009-ep-disconnected.avsc b/0009/0009-ep-disconnected.avsc index 4fcbe7a..21911ae 100644 --- a/0009/0009-ep-disconnected.avsc +++ b/0009/0009-ep-disconnected.avsc @@ -25,7 +25,23 @@ "doc":"Disconnected endpoints' IDs map to their application version names", "type":{ "type":"map", - "values":"string" + "values":{ + "type": "record", + "name": "EndpointMeta", + "doc":"Endpoint metadata.", + "fields":[ + { + "name":"appVersion", + "type":"string", + "doc":"Identifier of the endpoint application" + }, + { + "name":"tenantId", + "type":"string", + "doc":"Identifier of the endpoint tenant" + } + ] + } } }, { @@ -34,4 +50,4 @@ "doc":"Identifier of the service replica that generated the event" } ] -} +} \ No newline at end of file diff --git a/0009/README.md b/0009/README.md index aec3086..6c290bb 100644 --- a/0009/README.md +++ b/0009/README.md @@ -54,41 +54,57 @@ The NATS message payload is an Avro object with the following schema ([ep-connec ```json { - "namespace":"org.kaaproject.ipc.event.gen.v1.endpoint.connectivity", - "name":"ConnectedEvent", - "type":"record", - "doc":"Endpoints connected event message", - "fields":[ - { - "name":"correlationId", - "type":"string", - "doc":"Message ID primarily used to track message processing across services" - }, - { - "name":"timestamp", - "type":"long", - "doc":"Message creation UNIX timestamp in milliseconds" - }, - { - "name":"timeout", - "type":"long", - "default":0, - "doc":"Amount of milliseconds since the timestamp until the message expires. Value of 0 is reserved to indicate no expiration." - }, - { - "name":"endpoints", - "doc":"Connected endpoints' IDs map to their application version names", - "type":{ - "type":"map", - "values":"string" + "namespace":"org.kaaproject.ipc.event.gen.v1.endpoint.connectivity", + "name":"ConnectedEvent", + "type":"record", + "doc":"Endpoints connected event message", + "fields":[ + { + "name":"correlationId", + "type":"string", + "doc":"Message ID primarily used to track message processing across services" + }, + { + "name":"timestamp", + "type":"long", + "doc":"Message creation UNIX timestamp in milliseconds" + }, + { + "name":"timeout", + "type":"long", + "default":0, + "doc":"Amount of milliseconds since the timestamp until the message expires. Value of 0 is reserved to indicate no expiration." + }, + { + "name":"endpoints", + "doc":"Connected endpoints' IDs map to their application version names", + "type":{ + "type":"map", + "values":{ + "type":"record", + "name":"EndpointMeta", + "doc":"Endpoint metadata.", + "fields":[ + { + "name":"appVersion", + "type":"string", + "doc":"Identifier of the endpoint application" + }, + { + "name":"tenantId", + "type":"string", + "doc":"Identifier of the endpoint tenant" + } + ] } - }, - { - "name":"originatorReplicaId", - "type":"string", - "doc":"Identifier of the service replica that generated the event" - } - ] + } + }, + { + "name":"originatorReplicaId", + "type":"string", + "doc":"Identifier of the service replica that generated the event" + } + ] } ``` @@ -107,41 +123,57 @@ The NATS message payload is an Avro object with the following schema ([ep-discon ```json { - "namespace":"org.kaaproject.ipc.event.gen.v1.endpoint.connectivity", - "name":"DisconnectedEvent", - "type":"record", - "doc":"Endpoints disconnected event message", - "fields":[ - { - "name":"correlationId", - "type":"string", - "doc":"Message ID primarily used to track message processing across services" - }, - { - "name":"timestamp", - "type":"long", - "doc":"Message creation UNIX timestamp in milliseconds" - }, - { - "name":"timeout", - "type":"long", - "default":0, - "doc":"Amount of milliseconds since the timestamp until the message expires. Value of 0 is reserved to indicate no expiration." - }, - { - "name":"endpoints", - "doc":"Disconnected endpoints' IDs map to their application version names", - "type":{ - "type":"map", - "values":"string" + "namespace":"org.kaaproject.ipc.event.gen.v1.endpoint.connectivity", + "name":"DisconnectedEvent", + "type":"record", + "doc":"Endpoints disconnected event message", + "fields":[ + { + "name":"correlationId", + "type":"string", + "doc":"Message ID primarily used to track message processing across services" + }, + { + "name":"timestamp", + "type":"long", + "doc":"Message creation UNIX timestamp in milliseconds" + }, + { + "name":"timeout", + "type":"long", + "default":0, + "doc":"Amount of milliseconds since the timestamp until the message expires. Value of 0 is reserved to indicate no expiration." + }, + { + "name":"endpoints", + "doc":"Disconnected endpoints' IDs map to their application version names", + "type":{ + "type":"map", + "values":{ + "type":"record", + "name":"EndpointMeta", + "doc":"Endpoint metadata.", + "fields":[ + { + "name":"appVersion", + "type":"string", + "doc":"Identifier of the endpoint application" + }, + { + "name":"tenantId", + "type":"string", + "doc":"Identifier of the endpoint tenant" + } + ] } - }, - { - "name":"originatorReplicaId", - "type":"string", - "doc":"Identifier of the service replica that generated the event" - } - ] + } + }, + { + "name":"originatorReplicaId", + "type":"string", + "doc":"Identifier of the service replica that generated the event" + } + ] } ```