Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java ApacheCamel路由模板_Java_Templates_Routes_Apache Camel - Fatal编程技术网

Java ApacheCamel路由模板

Java ApacheCamel路由模板,java,templates,routes,apache-camel,Java,Templates,Routes,Apache Camel,我试图通过从属性文件创建骆驼路线模板来使用骆驼路线模板。我在官方网页上遵循这个示例,但代码没有编译: public class MyRouteTemplates extends RouteBuilder { @Override public void configure() throws Exception { // create a route template with the given name routeTemplate("myTemplate")

我试图通过从属性文件创建骆驼路线模板来使用骆驼路线模板。我在官方网页上遵循这个示例,但代码没有编译:

public class MyRouteTemplates extends RouteBuilder {

@Override
public void configure() throws Exception {
    // create a route template with the given name
    routeTemplate("myTemplate")
        // here we define the required input parameters (can have default values)
        .templateParameter("name")
        .templateParameter("greeting")
        .templateParameter("myPeriod", "3s")
        // here comes the route in the template
        // notice how we use {{name}} to refer to the template parameters
        // we can also use {{propertyName}} to refer to property placeholders
        .from("timer:{{name}}?period={{myPeriod}}")
            .setBody(simple("{{greeting}} ${body}"))
            .log("${body}");
}
更多详细信息,在哪里定义了
routeTemplate


感谢您的回复

我发现了窍门:路由模板是3.6.0快照的一部分

我使用的是Camel 3.4.4…您对
3.6
的看法是正确的,但是这个功能在
3.5
之前已经实现了一个小版本。非常感谢你!