This sample uses a service discovery configuration to control calls to the target API.
Consul is being used here as our service discovery provider.
The gateway will check the consul provider to find out available service nodes for the service 'testService'.
Once the gateway knows all the available nodes for a given service, it will use a round-robin algorithm to balance the traffic between them.
This sample is similar to the previous one, but it uses a proxy router middleware to resolve the destination (service name) that will be passed as input to the service discovery middleware.
This configuration will route the requests sending 97% of the requests to the service 'testService_v1' and only 3% for the 'testService_v2'. Then the service discovery middleware will find available nodes for the requested service and use a round-robin load balancer to choose one between these nodes.