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
158 stars 84 forks source link

General Dynamic IP Resolution for RSA #719

Closed pnoltes closed 4 months ago

pnoltes commented 5 months ago

Intro

With the current RSA implementation, Remote Service Admins can bound to multiple network interfaces (bind 0.0.0.0), but there is not clear defined way to ensure that discovery can work with endpoints that describe an exposed endpoint on multiple network interface and thus exposed with multiple IPs.

Improvements

a) Let RSA implementations decide if they support "dynamic IP fill-in" by providing a additional service property on the registered RSA service. if dynamic IP fill-in is supported, the RSA implementation should bind to ANY address (0.0.0.0)

b) The Topology Manager should handle RSA without "dynamic IP fill-in" as-is

c) And the Topology Manager should select which network interfaces are used for exported endpoint exposure. This can based on configuration (config properties) or on dynamic lookup. IP addresses that are not part of the selected interface should be ignore so that no communication is possible on not-selected IP addresses.

d) Update the Topology Manager to detect RSA services what support dynamic IP fill-in and in that case create multiple endpoints for a single export registration based on the available network interfaces and an optional network selection configuration. These endpoints are then forwarded to the discovery listener services that support network specific endpoints. The discovery implementation can pick and handle or drop endpoints based on the selected network interface.

The primary idea is that most of the boiler-plating to support dynamic IP fill-in is moved to the topology manager and kept away from the RSA and discovery implementations.

For the service/endpoint property something like the following can be used: