如何使用多个Jetty端点?

时间:2016-07-07 13:15:13

标签: java apache-camel jetty

是否有推荐的方法在apache camel中使用多个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 个答案:

答案 0 :(得分:1)

我们以相同的方式使用多个jetty端点。有一点我建议将端点uri添加到属性文件中。

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

在我看来,您可以考虑这些端点,例如关于具有多个操作的常规Web服务。每个操作都有不同的路径。所以没有什么特别的。