Load balancing (combined with "using Springcloud to build a single-node service provider on idea")
With the above Spring-cloud-producer as an example of modification, the controller changes as follows:
@RestController Public class Hellocontroller { @RequestMapping ("/hello") public String Index (@ Requestparam String name) { return "Hello" +name+ ", this is producer 2 send first Messge"; c13/>}}
To change the port in the configuration file:
spring.application.name=spring-cloud-producerserver.port=9003eureka.client.serviceUrl.defaultZone =http://localhost:8000/eureka/
Two service providers
After the package is started, the Eureka will find two service providers registered to a registry (Eureka.client.serviceurl.defaultzone=http://Localhost:8000/ eureka/), the consumer calls the provider with a balanced call (automatic polling)
Using Springcloud to build multi-node service provider load Balancing on idea