2014-11-20 2 views
1

Application.java봄 구름 - Zuul 서버 오류

@Configuration 
@ComponentScan 
@EnableAutoConfiguration 
@EnableZuulProxy 
public class ZuulServer { 

    public static void main(String[] args) { 
     SpringApplication.run(ZuulServer.class, args); 
    } 
} 

application.yml

eureka: 
    client: 
     enabled: true 
     serviceUrl: 
      defaultZone: http://localhost:8761/v2/ 

    zuul: 
    proxy: 
     route: 
     service1: /myservice1 
     service2: /myservice2 

예 호출

http://localhost:8080/proxy/myservice1/users 
http://localhost:8080/proxy/myservice2/auctionlots/today 

Predecoration 필터 (1.0을 사용하는데 다음과 같은 오류를 라우팅하는 동안 작동 .0.M2) :

Caused by: java.lang.NoSuchMethodError: com.netflix.hystrix.HystrixExecutableBase$ObservableCommand.toBlocking()Lrx/observables/BlockingObservable; 
     at com.netflix.hystrix.HystrixExecutableBase.queue(HystrixExecutableBase.java:342) 
     at com.netflix.hystrix.HystrixObservableCommand.queue(HystrixObservableCommand.java:50) 
     at com.netflix.hystrix.HystrixExecutableBase.execute(HystrixExecutableBase.java:296) 
     at com.netflix.hystrix.HystrixObservableCommand.execute(HystrixObservableCommand.java:50) 
     at com.netflix.hystrix.HystrixCommand.execute(HystrixCommand.java:485) 
     at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:162) 
     at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:86) 
     at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112) 
     at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:197) 
     ... 41 common frames omitted 

답변

2

@vladsfl 제공된 코드가있는 내 sample app이 작동합니다. 그 특별한 오류는 rxjava와 호환되지 않는 버전 (오래된 것일 수도 있음)에서 비롯됩니다. 내 샘플 버전 (hystrix와 호환되는 버전)은 com.netflix.rxjava:rxjava-core:jar:0.20.6입니다. 구성을 제공 할 수 있습니까? rxjava의 버전은 무엇입니까?