You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bundles/remote_services/README.md
+32-25Lines changed: 32 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,26 +33,25 @@ The topology manager decides which services should be imported and exported acco
33
33
34
34
### Remote Service Admin
35
35
36
-
The Remote Service Admin (RSA) provides the mechanisms to import and export services when instructed to do so by the Topology Manager.
36
+
The Remote Service Admin (RSA) provides the mechanisms to import and export services when instructed to do so by the Topology Manager.
37
37
38
-
#### Endpoints and proxies
38
+
#### Remote Service Admin DFI
39
39
40
-
To delegate a *received* method call to the actual service implementation, the RSA uses an "endpoint" bundle, which has all the knowledge about the marshalling and unmarshalling of data for the service. This endpoint bundle is specific to the used RSA implementation, and as such cannot be reused between various RSA implementations.
40
+
Provides remote service admin using HTTP and JSON. The serialization is done using [libdfi](../../libs/dfi/README.md) to convert function call information into [JSON representation](https://amdatu.atlassian.net/wiki/spaces/AMDATUDEV/pages/21954571/Amdatu+Remote#AmdatuRemote-AdminHTTP%2FJson).
41
+
`libffi` is configured using descriptor files in the bundles.
41
42
42
-
Invoking a *remote* method is done by using "proxy" bundles. Similar as to endpoints, proxy bundles encapsulate all knowledge to marshall and unmarshall data for a remote method call and as such can not be shared between RSA implementations.
43
-
44
-
Both proxy and endpoint bundles are loaded on demand when a service is imported or exported by the RSA. As such, these bundles **must** not be added to the list of "auto started" bundles, but placed in a separate location. By default, `endpoints` is used as location for locating proxy and/or endpoint bundles.
45
-
46
-
Note that since endpoints and proxies need to be created manually, one has full control about the handling of specifics of marshalling and unmarshalling data and dealing with exceptions.
43
+
|**Bundle**|`rsa_dfi.zip`|
44
+
|--|--|
45
+
|**Configuration**| See [Remote Service Admin DFI](remote_service_admin_dfi/README.md)|
47
46
48
-
#### HTTP/JSON
47
+
#### Remote Service Admin SHM
49
48
50
-
Provides a RSA implementation that uses JSON to marshal requests and HTTP as transport mechanism for its remote method invocation. It is compatible with the *Remote Service Admin HTTP* implementation provided by [Amdatu Remote](https://amdatu.atlassian.net/wiki/display/AMDATUDEV/Amdatu+Remote).
49
+
Provides remote service admin using shared memory. The serialization implementation is pluggable, and the default serialization is done using [libdfi](../../libs/dfi/README.md) to convert function call information into [JSON representation](https://amdatu.atlassian.net/wiki/spaces/AMDATUDEV/pages/21954571/Amdatu+Remote#AmdatuRemote-AdminHTTP%2FJson).
50
+
`libffi` is configured using descriptor files in the bundles.
51
51
52
-
|**Bundle**|`remote_service_admin_http.zip`|
53
-
|--|--|
54
-
|**Configuration**|`RSA_PORT`: defines the port on which the HTTP server should listen for incoming requests. Defaults to port `8888`; |
55
-
||`ENDPOINTS`: defines the location in which service endpoints and/or proxies can be found. Defaults to `endpoints` in the current working directory |
|**Configuration**| See [Remote Service Admin SHM](remote_service_admin_shm_v2/README.md)|
56
55
57
56
### Discovery
58
57
@@ -72,15 +71,22 @@ Provides a service discovery with preconfigured discovery endpoints, allowing a
72
71
73
72
Note that for configured discovery, the "Endpoint Description Extender" XML format defined in the OSGi Remote Service Admin specification (section 122.8 of OSGi Enterprise 5.0.0) is used.
74
73
75
-
See [etcd discovery](discovery_etcd/README.md)
76
-
77
74
#### etcd discovery
78
75
76
+
Provides a service discovery using etcd distributed key/value store.
77
+
79
78
|**Bundle**|`discovery_etcd.zip`|
79
+
|------------|----------------------|
80
+
|**Configuration**| See [etcd discovery](discovery_etcd/README.md)|
80
81
81
-
Provides a service discovery using etcd distributed key/value store.
82
+
#### Zero configuration discovery
83
+
84
+
Provides a service discovery using zeroconf (Bonjour).
85
+
86
+
|**Bundle**|`rsa_discovery_zeroconf.zip`|
87
+
|--|----------------------------|
88
+
|**Configuration**| See [Zeroconf Discovery](discovery_zeroconf/README.md)|
82
89
83
-
See [etcd discovery](discovery_etcd/README.md)
84
90
85
91
## Usage
86
92
@@ -129,26 +135,27 @@ Note that the `RSA_PORT` property needs to be unique for at least the client in
129
135
130
136
## Building
131
137
132
-
To build the Remote Service Admin Service the CMake build option "`BUILD_REMOTE_SERVICE_ADMIN`" has to be enabled.
138
+
To build the Remote Service Admin Service the CMake build option "`BUILD_REMOTE_SERVICE_ADMIN`" has to be enabled.If you use conan to build it, you should set the conan option `celix:build_remote_service_admin` to true.
133
139
134
140
## Dependencies
135
141
136
142
The Remote Service Admin Service depends on the following subprojects:
137
143
138
144
- Framework
139
145
- Utils
146
+
- dfi
147
+
- log_helper
140
148
141
-
Also the following libraries are required for building and/or using the Remote Service Admin Service subproject:
142
-
143
-
- Jansson (build and runtime)
144
-
- cURL (build and runtime)
145
149
146
150
## RSA Bundles
147
151
148
-
*[Remote Service Admin DFI](remote_service_admin_dfi) - A Dynamic Function Interface (DFI) implementation of the RSA.
149
-
*[Topology Manager](topology_manager) - A (scoped) RSA Topology Manager implementation.
152
+
*[Remote Service Admin DFI](remote_service_admin_dfi/README.md) - A Dynamic Function Interface (DFI) implementation of the RSA.
153
+
*[Remote Service Admin SHM](remote_service_admin_shm_v2/README.md) - A Shared Memory (SHM) implementation of the RSA.
154
+
*[Remote Service Admin RPC Using JSON](rsa_rpc_json/README.md) - A Remote Procedure Call (RPC) implementation of the RSA using JSON.
155
+
*[Topology Manager](topology_manager/README.md) - A (scoped) RSA Topology Manager implementation.
150
156
*[Discovery Configured](discovery_configured) - A RSA Discovery implementation using static configuration (xml).
151
157
*[Discovery Etcd](discovery_etcd/README.md) - A RSA Discovery implementation using etcd.
158
+
*[Discovery Zeroconf](discovery_zeroconf/README.md) - A RSA Discovery implementation using Bonjour.
| instance name | service name+hash(endpoint uuid) |
31
+
| service type | "_celix-rpc._udp"+${custom subtype} |
32
+
| domain name | "local" |
33
+
| txt record | service properties |
34
+
| host | "celix_rpc_dumb_host.local."(It is dummy) |
35
+
| port | 50009(It is dummy) |
36
+
37
+
38
+
Because We will perform the mDNS query only using link-local multicast, so we set domain name default value "local".
39
+
40
+
To reduce the operation of conversion between host name and address info. we set the address info to txt record, and set a dummy value("celix_rpc_dumb_host.local." and "50009") to the host name and port.
41
+
42
+
We set the instance name of the mDNS service as `service_name + hash(endpoint uuid)`. If there is a conflict in the instance name, mDNS_daemon will resolve it. Since the maximum size of the mDNS service instance name is 64 bytes, we take the hash of the endpoint uuid here, which also reduces the probability of instance name conflicts.
43
+
44
+
According to [rfc6763](https://www.rfc-editor.org/rfc/rfc6763.txt) 6.1 and 6.2 section, DNS TXT record can be up to 65535 (0xFFFF) bytes long in mDNS message. and we should keep the size of the TXT record under 1300 bytes(allowing it to fit in a single 1500-byte Ethernet packet). Therefore, `Discovery_zeroconf` announce celix service endpoint using multiple txt records and each txt record max size is 1300 bytes.
45
+
46
+
### Supported Platform
47
+
- Linux
48
+
49
+
### Conan Option
50
+
build_rsa_discovery_zeroconf=True Default is False
51
+
52
+
### CMake Option
53
+
RSA_DISCOVERY_ZEROCONF=ON Default is OFF
54
+
55
+
### Software Design
56
+
57
+
#### The Remote Service Endpoint Announce Process
58
+
59
+
In the process of publishing remote service endpoints, `discovery_zeroconf` provides an `endpoint_listener_t` service, and sets the service property `DISCOVERY=true`. `topology_manager` updates service endpoint description to `discovery_zeroconf` by calling this service. At the same time, `discovery_zeroconf` establishes a domain socket connection with `mDNS_daemon`, and `discovery_zeroconf` publishes the service information to mDNS_daemon through this connection. Then, `mDNS_daemon` publishes the service information to other `mDNS_daemons`. The sequence diagram is as follows:
#### The Remote Service Endpoint Discovery Process
64
+
65
+
In the process of discovering remote service endpoints, discovery_zeroconf also establishes a domain socket connection with mDNS_daemon. discovery_zeroconf listens to remote endpoint information through this connection, and updates the listened remote endpoint information to topology_manager. The sequence diagram is as follows:
0 commit comments