1

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})

错误信息

无法解析字符串值“sql:insert into table (column_name) values (:#${property.column_name})”中的占位符“property.column_name”

4

0 回答 0