【问题标题】:Apache Camel Route Template阿帕奇骆驼路线模板
【发布时间】:2023-03-03 07:28:28
【问题描述】:

我正在尝试通过从属性文件创建骆驼路线模板来使用它们。我在关注官网route template example上的例子,但是代码没有编译:

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定义在哪里?

感谢您的回复

【问题讨论】:

  • 我正在使用 Camel 3.4.4...

标签: java templates routes apache-camel


【解决方案1】:

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-01-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-09
  • 2013-02-09
相关资源
最近更新 更多