- Lets say that I have service A and B hosted in service fabric cluster. They listen (inside the cluster) on port 7001 and 7002 respectively.
- Lets say that I configure the service fabric load balancer to listen on port 8001 and forward the request to port 7001 (inside the cluster) for service A and listen on port 8002 and forward the request to port 7002 (inside the cluster) for service B.
- Lets say that I configure API management for service A and B and route the requests to appropriate ports on the load balancer.
- This all works.
- Now, instead of manually mapping url route for each service, I would like to dynamically discover services hosted in service fabric (from API management) and route the request at run time dynamically.
- To do this, I know I have to write a policy (in C# most likely) to look up this information from somewhere.
- But I am not sure exactly what to query to lookup load balanced ports and services hosted in service fabric cluster.
- I thought of creating another service C in the same service fabric cluster and use it (from API management) to provide the inside information of the cluster.
- But I was not able to find a way to either look up local service port information or load balanced service port information.
How do I go about it?