【发布时间】:2020-06-27 22:50:37
【问题描述】:
我有这些依赖项:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<exclusions>
<exclusion>
<artifactId>jaxp-ri</artifactId>
<groupId>com.sun.xml.parsers</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz2</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<exclusions>
<exclusion>
<artifactId>jaxp-ri</artifactId>
<groupId>com.sun.xml.parsers</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<exclusions>
<exclusion>
<artifactId>jaxp-ri</artifactId>
<groupId>com.sun.xml.parsers</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
我还添加了这个:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz2</artifactId>
</dependency>
我有一条简单的路线:
from("file:C:\\dev\\Repository\\ware3\\ff.txt?scheduler=quartz2&scheduler.cron=0/3 0/1 * 1/1 * ? *")
.routeId("testRoute")
.log(LoggingLevel.INFO, "******\n*******\n******File asdsaw name : fsa");
它应该每 3 秒调用一次此方法,但我看不到任何带有 **** 或“testroute”的日志。
我想做的是根据石英检查本地文件夹。如果我能成功,我会尝试 FTP,但现在它甚至不能用于本地文件夹。
路径是正确的,因为我可以获取文件
File initialFile = new File("C:\\dev\\Repository\\ware3\\ff.txt");
InputStream targetStream = null;
List<String> fileAsLines = null;
targetStream = new FileInputStream(initialFile);
【问题讨论】:
标签: spring spring-boot cron apache-camel