Skip to content

Commit 9eedd49

Browse files
czfdcnstevenhartley
authored andcommitted
uDiscovery Redesign
The following is the redesign of uDiscovery service based on the various lessons learned from deploying uDiscovery in production and valuable feedback from developers. uDiscovery is no longer a dumping ground for all forms of information but instead only stores service discovery information (service location, version, and service topic metadata). Co-authored-by: Christian Alexander <[email protected]> Co-authored-by: Kai Hudalla <[email protected]> #137
1 parent 121965e commit 9eedd49

20 files changed

+1119
-1926
lines changed

up-core-api/uprotocol/core/udiscovery/v3/udiscovery.proto

Lines changed: 60 additions & 296 deletions
Large diffs are not rendered by default.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under
8+
* the terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-FileType: SOURCE
12+
* SPDX-License-Identifier: Apache-2.0
13+
*/
14+
syntax = "proto3";
15+
16+
package uprotocol.core.udiscovery.v3;
17+
import "google/protobuf/timestamp.proto";
18+
import "uprotocol/uoptions.proto";
19+
import "uprotocol/v1/uri.proto";
20+
import "uprotocol/core/udiscovery/v3/udiscovery.proto";
21+
22+
option java_package = "org.eclipse.uprotocol.core.udiscovery.v3";
23+
option java_outer_classname = "UDiscoveryReplicatorProto";
24+
option java_multiple_files = true;
25+
26+
27+
// UDiscovery Replicator is a set of APIs that are used internal to UDiscovery to populate and replicate
28+
// information in the uDiscovery database. This API is for internal (to UDiscovery service) use only and
29+
// not accessible for client uEs to use.
30+
service UDiscoveryReplicator {
31+
option (uprotocol.service_name) = "core.udiscovery"; // Service name
32+
option (uprotocol.service_version_major) = 3;
33+
option (uprotocol.service_version_minor) = 0;
34+
option (uprotocol.service_id) = 1;
35+
36+
37+
// Add, update, or remove one or more UServiceTopic from the Udiscovery database.
38+
//
39+
// This API is used to add, update, or remove UServiceTopic information and is called from
40+
// between UDiscovery services (ex. local to domain, domain to central, etc..).
41+
// To remove a topic, simply set the ttl in SetServiceTopicsRequest to be 0.
42+
// The API returns a SetServiceTopicsResponse when the operation was successful, or it will return an
43+
// error (the method invocation fails) with one of the following reasons:
44+
// UCode.INVALID_ARGUMENT - The URI passed is invalid
45+
// UCode.PERMISSION_DENIED - The caller is not permissed to set the UServiceTopics for that service.
46+
rpc SetServiceTopics(SetServiceTopicsRequest) returns (SetServiceTopicsResponse) {
47+
option (uprotocol.method_id) = 10;
48+
}
49+
}
50+
51+
// Request message for SetServiceTopics that contains a repeated list of service topic metadata
52+
message SetServiceTopicsRequest {
53+
// The topics to add (update) in the database.
54+
repeated ServiceTopicInfo topics = 1;
55+
56+
// How long the topic metadata (in seconds) is valid for from the moment the API is called.
57+
// If the metadata has expired, the UDiscovery service that received this data must flush the ServiceTopic info.
58+
// If the field is missed, the ServiceTopicInfo is valid forever.
59+
// If the field is set to 0, the ServiceTopicInfo should be removed from the database immediately.
60+
optional uint32 ttl = 2;
61+
}
62+
63+
64+
// Empty message returned from SetServiceTopics when the command returned successfully
65+
message SetServiceTopicsResponse {}
66+

0 commit comments

Comments
 (0)