Loadbalancer

Load balancer

Prerequisite: Learn first eureka, feign client, bais of spring boot

  • Step 1

Remove url in proxy class

//@FeignClient(name = "currency-exchange", url = "localhost:8000")  
@FeignClient(name = "currency-exchange")  
public interface CurrencyExchangeProxy {  
  
    @GetMapping("currency-exchange/from/{from}/to/{to}")  
    public CurrencyConversion getCurrencyExchange(@PathVariable String from, @PathVariable String to);  
  
}  

{
"id": 10001,
"from": "USD",
"to": "INR",
"conversionMultiple": 65.00,
"quantity": 10,
"totalCalculatedAmount": 650.00,
"environment": "8001"
}

You will get different environment after every 30 sec