阿帕奇骆驼日期

问题描述

我使用骆驼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不支持命令”

我在这里想念什么吗?

谢谢

解决方法

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

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...