apache / celix

Apache Celix is a framework for C and C++14 to develop dynamic modular software applications using component and in-process service-oriented programming.
https://celix.apache.org/
Apache License 2.0
165 stars 86 forks source link

Improve zeroconf discovery #710

Closed xuzhenbao closed 7 months ago

xuzhenbao commented 9 months ago

Fix some issues of #690 and improve zeroconf_discovery.

1.Improve zeroconf_discovery and add hostname resolving mechanism. 2.Rename remote service bundles. 3.Add zeroconf configuration type for rsa_dfi. 4.Add remote.configs.supported property for remote_service_admin service.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 102 lines in your changes are missing coverage. Please review.

Comparison is base (70548d6) 88.85% compared to head (e48e5ed) 89.32%. Report is 12 commits behind head on master.

Files Patch % Lines
...e_services/topology_manager/src/topology_manager.c 92.16% 34 Missing :warning:
...iscovery_zeroconf/src/discovery_zeroconf_watcher.c 94.56% 33 Missing :warning:
...e_service_admin_dfi/src/remote_service_admin_dfi.c 85.58% 16 Missing :warning:
...covery_zeroconf/src/discovery_zeroconf_announcer.c 93.25% 12 Missing :warning:
...ice_admin_dfi/src/remote_service_admin_activator.c 76.92% 3 Missing :warning:
...n_shm_v2/rsa_shm/src/rsa_shm_import_registration.c 77.77% 2 Missing :warning:
...te_service_admin_dfi/src/import_registration_dfi.c 80.00% 1 Missing :warning:
...n_shm_v2/rsa_shm/src/rsa_shm_export_registration.c 90.90% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #710 +/- ## ========================================== + Coverage 88.85% 89.32% +0.47% ========================================== Files 216 216 Lines 24293 25153 +860 ========================================== + Hits 21585 22469 +884 + Misses 2708 2684 -24 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

xuzhenbao commented 8 months ago

@pnoltes

I have updated the PR, it includes the following changes:

1.Move the work of exporting dynamic IP endpoints to the Topology Manager, the dynamic IP endpoints contain the following specific properties.

  1. The endpoint listener service of Discovery adds the property celix.rsa.discovery.interface.specific.endpoints.support, which indicates whether DISCOVERY supports dynamic IP filling based on the network interface name.

  2. The RSA service adds the property celix.rsa.dynamic.ip.support, which indicates whether RSA supports dynamic IP. When the celix.rsa.dynamic.ip.support property is true, the Topology Manager should generate dynamic IP endpoints based on the registration exported by RSA, and notify these endpoints to the DISCOVERY implementation that supports dynamic IP.

  3. Add configuration property CELIX_RSA_INTERFACES_OFPORT (e.g. CELIX_RSA_INTERFACES_OF_PORT_8080=eth0,eth1), which indicates to which network interfaces the server of the corresponding port should be bound. The Topology Manager should fill in the celix.rsa.ifname property based on these configurations when creating dynamic IP endpoints.

  4. Add the Facility of libcurl error codes, which is used to distinguish between http status code (CELIX_FACILITY_HTTP) and libcurl error codes in rsa_dfi

  5. Add CELIX_RSA prefix for constants in the rsa_spi

  6. celix.rsa.ip.addresses currently uses a comma-separated string, and it will use a string array (It depends on https://github.com/apache/celix/issues/674)

  7. Topology Manager and RSA_DFI still leave some deprecated interfaces usage, and the related code is planned to be cleaned up in other PRs.

pnoltes commented 8 months ago

7. nd it will use a string array (

Thanks for the trigger, I will try to find some time to review this in the coming days.