阿帕奇骆驼日期

时间:2020-08-27 10:16:02

标签: apache-camel simpledateformat

我使用骆驼2.12.3版本

我想获取文件名的昨天日期。

https://camel.apache.org/components/latest/languages/simple-language.html开始建立文档

所以我的编码如下:

<setProperty propertyName="exportFileName">
            <camel:simple>${date:now-24h:yyyyMMdd}</camel:simple>
</setProperty>

我遇到此错误“ java.lang.IllegalArgumentException:dateExpression:now-24h不支持命令”

我在这里想念什么吗?

谢谢

1 个答案:

答案 0 :(得分:0)

您的版本太旧了。在当前版本的Camel 2.x中有效,但在2.12.x中无效

顺便说一句:注意右上角的Camel组件文档中的版本切换器。您必须从最新版本切换到2.x版本才能查看正确的文档。但是,即使是2.x文档也描述了2.x的当前版本,因此在这种情况下,您也会遇到同样的问题:-)