Redefine discovery and register service interface protocol
This commit is contained in:
parent
b3c39aea53
commit
16fe2ba503
|
|
@ -0,0 +1,50 @@
|
|||
syntax = "proto3";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "org.skywalking.apm.network.trace.proto";
|
||||
|
||||
import "Downstream.proto";
|
||||
|
||||
//discovery service for application instance, this service is called when application starts
|
||||
//or http client connection switch to another collector server instance
|
||||
service InstanceDiscoveryService {
|
||||
rpc register (ApplicationInstance) returns (ApplicationInstanceMapping) {
|
||||
}
|
||||
|
||||
rpc registerRecover (ApplicationInstanceMapping) returns (Downstream) {
|
||||
}
|
||||
}
|
||||
|
||||
message ApplicationInstance {
|
||||
string applicationCode = 1;
|
||||
}
|
||||
|
||||
message ApplicationInstanceMapping {
|
||||
int32 applicationInstanceId = 1;
|
||||
int64 registerTime = 2;
|
||||
}
|
||||
|
||||
//discovery service for ServiceName by Network address or application code
|
||||
service ServiceNameDiscoveryService {
|
||||
rpc discovery (ServiceNameCollection) returns (ServiceNameMappingCollection) {
|
||||
}
|
||||
}
|
||||
|
||||
message ServiceNameCollection {
|
||||
repeated ServiceNameElement elements = 1;
|
||||
}
|
||||
|
||||
message ServiceNameMappingCollection {
|
||||
repeated ServiceNameMappingElement elements = 1;
|
||||
}
|
||||
|
||||
message ServiceNameMappingElement {
|
||||
int32 serviceId = 1;
|
||||
ServiceNameElement element = 1;
|
||||
}
|
||||
|
||||
message ServiceNameElement {
|
||||
ServiceName = 0;
|
||||
ApplicationCode = 1;
|
||||
}
|
||||
|
||||
|
|
@ -5,47 +5,16 @@ option java_package = "org.skywalking.apm.network.trace.proto";
|
|||
|
||||
//register service for ApplicationCode, this service is called when service starts.
|
||||
service ApplicationRegisterService {
|
||||
rpc register (ApplicationMetaInfo) returns (ApplicationRegiseredInfo) {
|
||||
rpc register (Application) returns (ApplicationMapping) {
|
||||
}
|
||||
}
|
||||
|
||||
message ApplicationMetaInfo {
|
||||
message Application {
|
||||
string applicationCode = 1;
|
||||
}
|
||||
|
||||
message ApplicationRegiseredInfo {
|
||||
message ApplicationMapping {
|
||||
int32 applicationId = 1;
|
||||
int32 applicationInstanceId = 2;
|
||||
}
|
||||
|
||||
//register service for ServiceName, Network address
|
||||
service DictionaryRegisterService {
|
||||
rpc register (DictionaryRegisterMetaInfo) returns (DictionaryRegiseredInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
message DictionaryRegisterMetaInfo {
|
||||
repeated DictionaryRegisterElement elements = 1;
|
||||
}
|
||||
|
||||
message DictionaryRegisterElement {
|
||||
RegisterElementType type = 1;
|
||||
string name = 2;
|
||||
}
|
||||
|
||||
message DictionaryRegiseredInfo {
|
||||
repeated DictionaryRegiseredElement elements = 1;
|
||||
}
|
||||
|
||||
message DictionaryRegiseredElement {
|
||||
RegisterElementType type = 1;
|
||||
string name = 2;
|
||||
int32 id = 3;
|
||||
}
|
||||
|
||||
|
||||
enum RegisterElementType {
|
||||
ServiceName = 0;
|
||||
NetworkAddress = 1;
|
||||
Application = 2;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue