-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
121965e
commit 9eedd49
Showing
20 changed files
with
1,119 additions
and
1,926 deletions.
There are no files selected for viewing
356 changes: 60 additions & 296 deletions
356
up-core-api/uprotocol/core/udiscovery/v3/udiscovery.proto
Large diffs are not rendered by default.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
up-core-api/uprotocol/core/udiscovery/v3/udiscovery_replicator.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under | ||
* the terms of the Apache License Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-FileType: SOURCE | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
syntax = "proto3"; | ||
|
||
package uprotocol.core.udiscovery.v3; | ||
import "google/protobuf/timestamp.proto"; | ||
import "uprotocol/uoptions.proto"; | ||
import "uprotocol/v1/uri.proto"; | ||
import "uprotocol/core/udiscovery/v3/udiscovery.proto"; | ||
|
||
option java_package = "org.eclipse.uprotocol.core.udiscovery.v3"; | ||
option java_outer_classname = "UDiscoveryReplicatorProto"; | ||
option java_multiple_files = true; | ||
|
||
|
||
// UDiscovery Replicator is a set of APIs that are used internal to UDiscovery to populate and replicate | ||
// information in the uDiscovery database. This API is for internal (to UDiscovery service) use only and | ||
// not accessible for client uEs to use. | ||
service UDiscoveryReplicator { | ||
option (uprotocol.service_name) = "core.udiscovery"; // Service name | ||
option (uprotocol.service_version_major) = 3; | ||
option (uprotocol.service_version_minor) = 0; | ||
option (uprotocol.service_id) = 1; | ||
|
||
|
||
// Add, update, or remove one or more UServiceTopic from the Udiscovery database. | ||
// | ||
// This API is used to add, update, or remove UServiceTopic information and is called from | ||
// between UDiscovery services (ex. local to domain, domain to central, etc..). | ||
// To remove a topic, simply set the ttl in SetServiceTopicsRequest to be 0. | ||
// The API returns a SetServiceTopicsResponse when the operation was successful, or it will return an | ||
// error (the method invocation fails) with one of the following reasons: | ||
// UCode.INVALID_ARGUMENT - The URI passed is invalid | ||
// UCode.PERMISSION_DENIED - The caller is not permissed to set the UServiceTopics for that service. | ||
rpc SetServiceTopics(SetServiceTopicsRequest) returns (SetServiceTopicsResponse) { | ||
option (uprotocol.method_id) = 10; | ||
} | ||
} | ||
|
||
// Request message for SetServiceTopics that contains a repeated list of service topic metadata | ||
message SetServiceTopicsRequest { | ||
// The topics to add (update) in the database. | ||
repeated ServiceTopicInfo topics = 1; | ||
|
||
// How long the topic metadata (in seconds) is valid for from the moment the API is called. | ||
// If the metadata has expired, the UDiscovery service that received this data must flush the ServiceTopic info. | ||
// If the field is missed, the ServiceTopicInfo is valid forever. | ||
// If the field is set to 0, the ServiceTopicInfo should be removed from the database immediately. | ||
optional uint32 ttl = 2; | ||
} | ||
|
||
|
||
// Empty message returned from SetServiceTopics when the command returned successfully | ||
message SetServiceTopicsResponse {} | ||
|
Oops, something went wrong.