在 Camel 2.17.0 中,camel sql组件在外部化时无法使用简单表达式解析属性值。
<route>
<from uri="timer://foo?repeatCount=1" />
<setProperty propertyName="column_name">
<simple>1234</simple>
</setProperty>
<!-- could nto resolve property - failed ->
<to uri="sql:{{sql.query}}" />
<!-- working ->
<to uri="sql:classpath:sql.query.sql?dataSource=#DS" />
</route>
外部属性文件:
sql.query = insert into table (column_name) values (:#${property.column_name})
错误消息:
无法在字符串值中解析占位符'property.column_name' “sql:insert into table(column_name)values (:#$ {property.column_name})“