2016-07-07 58 views
-1

是否有推薦的方法來在apache駱駝中使用多個碼頭端點?如何使用多個Jetty端點?

我正在使用下面的代碼。我不確定這是否正確。

import org.apache.camel.builder.RouteBuilder; 

public class CamelPocRoute extends RouteBuilder { 

    public void configure() { 

     from("jetty:http://localhost:8111/nordic/Something1") 
     .to("file://{{Somepath}}/camelpoc/jetty/Something1"); 

     from("jetty:http://localhost:8111/nordic/Something2") 
     .to("file://{{Somepath}}/camelpoc/jetty/Something2"); 

     from("jetty:http://localhost:8111/nordic/Something3") 
     .to("file://{{Somepath}}/camelpoc/jetty/Something3"); 
    } 

} 

參見:http://camel.apache.org/jetty.html

回答

1

我們使用多個碼頭終點相同的方式。有一件事我會推薦它將終端URI添加到屬性文件中。

from(endpoint("{{from.endpoint.url}}")) 

在我看來,你可以考慮像通常的Web服務與多個操作這些端點。這些操作都有不同的路徑。所以沒有什麼特別的。

相關問題