The setup:
- Spring-boot service S1 registers with discovery service via discovery client DC1.
- This service S1 needs to connect to Hazelcast cluster (which is also registered with the same discovery service).
- Hazelcast client config also needs discovery client DC2 configured to discover Hazelcast cluster nodes.
The ask: allow DC1 to be used for Hazelcast client discovery by proving the ability to supply Hazelcast cluster name (using metadata property for example).
More explicitly, EurekaOneDiscoveryStrategy.discoverNodes() method determines "applicationName" by calling applicationInfoManager.getEurekaInstanceConfig().getAppname(). This creates an issue since "applicationName" returned is the name under which the service S1 is registered with Eureka instead of the name of the application under which the Hazelcast cluster is registered.