`
文章列表
@SpringBootApplication spring.application.name=config-server server.port=7001 # git管理配置 #spring.cloud.config.server.git.uri=http://git.oschina.net/didispace/SpringBoot-Learning/ #spring.cloud.config.server.git.searchPaths=Chapter9-1-4/config-repo #spring.cloud.config.server.git.username=u ...

Spring Cloud Eureka

@EnableEurekaServer server.port=1111 eureka.client.register-with-eureka=false eureka.client.fetch-registry=false eureka.client.serviceUrl.defaultZone=http://localhost:${server.port}/eureka/ 思考: 1、eureka集群方案用两两互相注册机制客户端与几个eureka产生连接 2、eureka集群方案中同步机制如何实现和保证数据一致性。 3、eureka客户端如何注册、如何感知变化的服务 ...
@HystrixCommand(fallbackMethod = "addServiceFallback") public String add(Integer a, Integer b) { return restTemplate.getForEntity("http://MY-SERVICE/add?a=" + a + "&b=" + b, String.class).getBody(); } public String addServiceFallback(I ...
Ribbon通过引入RestTemplate实现客户端调用, @Bean @LoadBalanced RestTemplate restTemplate() { return new RestTemplate(); } @FeignClient("my-service") public interface MyClient { @RequestMapping(value = "/add", method = RequestMethod.GET) I ...
Global site tag (gtag.js) - Google Analytics