Advertisement
Guest User

Untitled

a guest
May 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. @EnableZuulProxy
  2. @EnableDiscoveryClient
  3. @SpringBootApplication
  4. public class GatewayApplication {
  5. static RequestQueue q = new RequestQueue();
  6.  
  7. public static void main(String[] args) {
  8. q.start();
  9. SpringApplication.run(GatewayApplication.class, args);
  10. }
  11.  
  12. @Bean
  13. public LogIncomingRequest logIncomingRequest() {
  14. return new LogIncomingRequest(q);
  15. }
  16.  
  17. @Bean
  18. public LogLeavingRequest logLeavingRequest() {
  19. return new LogLeavingRequest(q);
  20. }
  21.  
  22. server:
  23. port: 4000
  24.  
  25. spring:
  26. application:
  27. name: zuul-gateway
  28.  
  29. zuul:
  30. sensitive-headers:
  31.  
  32. eureka:
  33. client:
  34. serviceUrl:
  35. defaultZone: http://${EUREKA:10.0.2.15:8761}/eureka/
  36. register-with-eureka: true
  37. fetch-registry: true
  38. instance:
  39. prefer-ip-address: true
  40.  
  41. hystrix:
  42. command:
  43. default:
  44. execution:
  45. isolation:
  46. thread:
  47. timeoutInMilliseconds: 60000
  48.  
  49. @Component
  50. public class RibbonInterceptor extends ZoneAvoidanceRule {
  51.  
  52. @Override
  53. public Server choose(Object key) {
  54. Server choose = super.choose(key);
  55. System.out.println(choose);
  56. return choose;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement