mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
pass code check
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -62,8 +62,13 @@ public class ConsumerSCLBApplication {
|
||||
return new RestTemplate();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConsumerSCLBApplication.class, args);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@LoadBalancerClient(value = "service-provider", configuration = MyLoadBalancerConfiguration.class)
|
||||
@LoadBalancerClient(value = "service-provider",
|
||||
configuration = MyLoadBalancerConfiguration.class)
|
||||
class MySCLBConfiguration {
|
||||
|
||||
}
|
||||
@@ -79,7 +84,7 @@ public class ConsumerSCLBApplication {
|
||||
|
||||
private final Random random;
|
||||
|
||||
public RandomLoadBalancer(
|
||||
RandomLoadBalancer(
|
||||
ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider,
|
||||
String serviceId) {
|
||||
this.serviceInstanceListSupplierProvider = serviceInstanceListSupplierProvider;
|
||||
@@ -104,6 +109,7 @@ public class ConsumerSCLBApplication {
|
||||
|
||||
return new DefaultResponse(instance);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@FeignClient(name = "service-provider")
|
||||
@@ -126,6 +132,7 @@ public class ConsumerSCLBApplication {
|
||||
|
||||
@RestController
|
||||
class TestController {
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@@ -145,8 +152,4 @@ public class ConsumerSCLBApplication {
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConsumerSCLBApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@@ -3,4 +3,4 @@ server.port=18083
|
||||
management.endpoints.web.exposure.include=*
|
||||
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
|
||||
|
||||
spring.cloud.loadbalancer.ribbon.enabled=false
|
||||
spring.cloud.loadbalancer.ribbon.enabled=false
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,8 +42,13 @@ public class ConsumerReactiveApplication {
|
||||
return WebClient.builder();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConsumerReactiveApplication.class, args);
|
||||
}
|
||||
|
||||
@RestController
|
||||
class MyController {
|
||||
|
||||
@Autowired
|
||||
private ReactiveDiscoveryClient reactiveDiscoveryClient;
|
||||
|
||||
@@ -63,10 +68,7 @@ public class ConsumerReactiveApplication {
|
||||
.uri("http://service-provider/echo/" + name).retrieve()
|
||||
.bodyToMono(String.class);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ConsumerReactiveApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -3,4 +3,4 @@ server.port=18083
|
||||
management.endpoints.web.exposure.include=*
|
||||
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
|
||||
|
||||
spring.cloud.loadbalancer.ribbon.enabled=false
|
||||
spring.cloud.loadbalancer.ribbon.enabled=false
|
||||
|
Reference in New Issue
Block a user