Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EnableZuulProxy
- @EnableDiscoveryClient
- @SpringBootApplication
- public class GatewayApplication {
- static RequestQueue q = new RequestQueue();
- public static void main(String[] args) {
- q.start();
- SpringApplication.run(GatewayApplication.class, args);
- }
- @Bean
- public LogIncomingRequest logIncomingRequest() {
- return new LogIncomingRequest(q);
- }
- @Bean
- public LogLeavingRequest logLeavingRequest() {
- return new LogLeavingRequest(q);
- }
- server:
- port: 4000
- spring:
- application:
- name: zuul-gateway
- zuul:
- sensitive-headers:
- eureka:
- client:
- serviceUrl:
- defaultZone: http://${EUREKA:10.0.2.15:8761}/eureka/
- register-with-eureka: true
- fetch-registry: true
- instance:
- prefer-ip-address: true
- hystrix:
- command:
- default:
- execution:
- isolation:
- thread:
- timeoutInMilliseconds: 60000
- @Component
- public class RibbonInterceptor extends ZoneAvoidanceRule {
- @Override
- public Server choose(Object key) {
- Server choose = super.choose(key);
- System.out.println(choose);
- return choose;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement