we decided to go for Axon for our project. The infrastructure uses Rancher for service discovery, so I am currently writing a DiscoveryClient that utilizes Rancher Metadata API to pull meta information about all service instances currently active in the rancher cluster.
However I have a problem to route commands to other instances in the cluster. I receive the exception that there couldnt be found any matching node for the command.
The problem is that the SpringCloudCommandRouter expects some metadata properties in the ServiceInstances returned from DiscoveryClient, that I cannot provide (because it is not configured/configurable in Rancher). The metadata properties are to find out what segments accept which kind of commands by specifying filters.
We want to configure this independent of what is configured on the ServiceInstance in the ServiceDiscovery provider, i. e. we want to set it once for the whole cluster to achieve something like this: MicroserviceA-Cluster accepts all commands from other MicroserviceA instances. We achieve this by letting the DiscoveryClient ask Rancher only for instances of the same type, i. e. the DiscoveryClient would only return ServiceInstances for MicroserviceA, if MicroserviceA is calling Rancher.
Maybe I also get the concept a bit wrong, but currently it looks like that I have to write some kind of hack, or to even write my own CommandRouter to get it working.
Any advise is appreciated.