在apache骆驼中读取文件时检查fileExists

时间:2021-05-17 09:57:07

标签: java apache-camel dsl spring-dsl

我需要在 Apache camel 中从文件夹中读取特定文件。如果文件存在则处理否则发送电子邮件。您能否建议如何实现这一目标。

我尝试了下面的代码,但如果文件不存在,则控制不会到达其他块 -

from("file:inbox?antInclude=*74_INT.json").
    choice().
        when(body().isNotNull()).
            process(new fileProcess()).
        otherwise().
            process(new emailProcess());

0 个答案:

没有答案