2017-02-17 31 views
0

我有一个使用骆驼码头组件作为网关的骆驼端点路由的Spring Boot应用程序。如何使用Camel Jetty组件的Spring Boot中的Jetty?

@Component 
public class StartEcommerce extends RouteBuilder { 

    @Override 
    public void configure() throws Exception { 

    restConfiguration() 
     .host("localhost") 
     .port(8085); 

    rest("/rest/v1") 
     .post("/order") 
      .to("direct:ecommerceRestRoute") 
     .post("/cancelEnrollment") 
      .to("direct:cancelEnrollmentRestRoute"); 

    // other routes ... 
    } 

}

一切工作正常,如果我把码头分量端口执行8085.

不过,我想使用已经在8081端口上运行春季启动的码头,因为我想有机会获得健康检查从执行端点和能叫我休息端点这样的:

localhost:8081/health 
localhost:8081/rest/v1/order 
localhost:8081/rest/v1/cancelEnrollment 

试图按照这种讨论

Use existing http server in spring boot as camel endpoint

,但我得到了下面的错误,因为我有相同的端口

*************************** 
APPLICATION FAILED TO START 
*************************** 

Description: 

Embedded servlet container failed to start. Port 8081 was already in use. 

Action: 

Identify and stop the process that's listening on port 8081 or configure this application to listen on another port. 

上运行两个Jettys我用骆驼码头2.18.0的春天引导1.4.2。发布。

任何建议我该如何做到这一点?

回答

相关问题