【发布时间】: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