我正在运行一个使用Apache Camel进行文件处理的应用程序。该应用程序可以在我的Windows和CentOS上完美运行以进行测试。
但是,当在RHEL上运行时,我得到一个奇怪的行为,显示的信息很少。这是日志的一部分:
Configured property: initialDelay on bean: org.apache.camel.impl.DefaultScheduledPollConsumerScheduler@ad834fbd with value: 1000
2019-02-28 16:09:46,037 main TRACE org.apache.camel.util.IntrospectionSupport Configured property: delay on bean: org.apache.camel.impl.DefaultScheduledPollConsumerScheduler@ad834fbd with value: 500
2019-02-28 16:09:46,037 main TRACE org.apache.camel.util.IntrospectionSupport Configured property: useFixedDelay on bean: org.apache.camel.impl.DefaultScheduledPollConsumerScheduler@ad834fbd with value: true
2019-02-28 16:09:46,037 main TRACE org.apache.camel.util.IntrospectionSupport Configured property: scheduledExecutorService on bean: org.apache.camel.impl.DefaultScheduledPollConsumerScheduler@ad834fbd with value:
2019-02-28 16:09:46,037 main TRACE org.apache.camel.util.IntrospectionSupport Configured property: timeUnit on bean: org.apache.camel.impl.DefaultScheduledPollConsumerScheduler@ad834fbd with value: MILLISECONDS
2019-02-28 16:09:46,037 main TRACE org.apache.camel.support.ServiceSupport Starting service
2019-02-28 16:09:46,037 main DEBUG org.apache.camel.impl.DefaultExecutorServiceManager Created new ScheduledThreadPool for source: Consumer[file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500] with name: file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500 -> org.apache.camel.util.concurrent.SizedScheduledExecutorService@bac57329[file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500]
2019-02-28 16:09:46,037 main DEBUG o.a.camel.impl.DefaultScheduledPollConsumerScheduler Scheduling poll (fixed delay) with initialDelay: 1000, delay: 500 (milliseconds) for: file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500
2019-02-28 16:09:46,037 main TRACE o.a.c.util.concurrent.SizedScheduledExecutorService canScheduleOrExecute 0 < 1000 -> true
2019-02-28 16:09:46,038 main TRACE org.apache.camel.util.concurrent.CamelThreadFactory Created thread[Camel (CamelContext) thread #58 - file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX] -> Thread[Camel (CamelContext) thread #58 - file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX,5,main]
2019-02-28 16:09:46,038 main INFO org.apache.camel.spring.SpringCamelContext Route: FRIDABaseIIFileOutgoingTransport started and consuming from: file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500
2019-02-28 16:09:46,038 main TRACE org.apache.camel.support.ServiceSupport Starting service
2019-02-28 16:09:46,038 main INFO org.apache.camel.spring.SpringCamelContext Apache Camel 2.21.1 (CamelContext: CamelContext) is shutting down
2019-02-28 16:09:46,038 main TRACE org.apache.camel.util.ServiceHelper Stopping service org.a down service org.apache.camel.impl.DefaultRouteController@36b5248f
2019-02-28 16:09:46,038 main TRACE org.apache.camel.support.ServiceSupport Servpache.camel.impl.DefaultRouteController@36b5248f
2019-02-28 16:09:46,038 main TRACE org.apache.camel.util.ServiceHelper Shuttingice already stopped
2019-02-28 16:09:46,039 main INFO org.apache.camel.impl.DefaultShutdownStrategy Starting to graceful shutdown 26 routes (timeout 300 seconds)
2019-02-28 16:09:46,039 main DEBUG org.apache.camel.impl.DefaultExecutorServiceManager Created new ThreadPool for source: org.apache.camel.impl.DefaultShutdownStrategy@1950c033 with name: ShutdownTask. -> org.apache.camel.util.concurrent.RejectableThreadPoolExecutor@33d3ff79[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0][ShutdownTask]
2019-02-28 16:09:46,040 main TRACE org.apache.camel.util.concurrent.CamelThreadFactory Created thread[Camel (CamelContext) thread #59 - ShutdownTask] -> Thread[Camel (CamelContext) thread #59 - ShutdownTask,5,main]
2019-02-28 16:09:46,040 Camel (CamelContext) thread #59 - ShutdownTask DEBUG org.apache.camel.impl.DefaultShutdownStrategy There are 26 routes to shutdown
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask TRACE org.apache.camel.impl.DefaultShutdownStrategy Shutting down route: FRIDABaseIIFileOutgoingTransport with options [Default,CompleteCurrentTaskOnly]
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask TRACE org.apache.camel.impl.DefaultShutdownStrategy Suspending: Consumer[file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500]
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask TRACE org.apache.camel.util.ServiceHelper Suspending service Consumer[file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500]
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask TRACE org.apache.camel.impl.DefaultShutdownStrategy Suspend complete for: Consumer[file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500]
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask DEBUG org.apache.camel.impl.DefaultShutdownStrategy Route: FRIDABaseIIFileOutgoingTransport suspended and shutdown deferred, was consuming from: file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/BASEII_FRIDA_OUTGOING_PROC/CORPORATION_8/TO_PROCESS_STX?charset=UTF-8&doneFileName=%24%7Bfile%3Aname%7D.stx&move=.done&moveFailed=.error&readLock=changed&readLockCheckInterval=1500
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask TRACE org.apache.camel.impl.DefaultShutdownStrategy Shutting down route: FileErrorsReportToDB with options [Default,CompleteCurrentTaskOnly]
2019-02-28 16:09:46,041 Camel (CamelContext) thread #59 - ShutdownTask DEBUG org.apache.camel.impl.DefaultShutdownStrategy
在第一行之前,对每个文件使用方路径重复日志基本上是同一件事。
上下文永不停止...它保持运行状态,文件使用方不断记录以下内容:
2019-02-28 16:09:46,996 Camel (CamelContext) thread #37 - file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/LOGISTIC/CORPORATION_8/TO_PROCESS_STX/temp4 TRACE org.apache.camel.impl.ScheduledPollConsumer Cannot start to poll: file:///opt/IBM/WebSphere90/tmp/FILES/OUT/PROCESSED/LOGISTIC/CORPORATION_8/TO_PROCESS_STX/temp4?charset=UTF-8&exclude=TEMP_.*&move=.done&moveFailed=.error&readLock=rename as its suspended
找不到原因。任何想法?谢谢!
答案 0 :(得分:1)
似乎您的“主要”设备没有保持运转。因此,当应用程序启动时,骆驼会初始化并配置路由。但是,“主要”只是立即结束。 不解释为什么为什么不能在一个操作系统上运行而在另一个操作系统上运行,但是在这两个环境上可能还有其他不同吗?
您正在使用Spring Boot吗?
查看此内容:http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html