SimpleParserException:未知函数:property.fileName

uzx*_*024 2 apache-camel camel-sql

我正在使用 Apache Camel 3.0,解析文件时出现此错误:

    from("file:" + filePath)
            .routeId("create-ticket")
            .unmarshal(ticketCsv)
            .to("jpa:Ticket")
            .log("Created new ticket with id ${body.id}")
            .convertBodyTo(String.class)
            .setProperty("fileName", simple("${header.CamelFileAbsolutePath}"))
            .setProperty("fileContents", body())
            .to("sql:INSERT INTO DOCUMENT(document_name, document_contents) VALUES(:#${property.fileName}, :#${property.fileContents})");
Run Code Online (Sandbox Code Playgroud)

例外:

org.apache.camel.language.simple.types.SimpleIllegalSyntaxException:未知函数:property.fileName位于位置0 ${property.fileName}

Cla*_*sen 8

${property.xxx}在 2.x 中已弃用。使用${exchangeProperty.xxx}该函数的正确名称。

更多更改可以在迁移指南中找到