【发布时间】:2017-08-14 01:16:27
【问题描述】:
我正在尝试捕获 apache 骆驼路由器的开始时间和结束时间。 我们使用骆驼进行消息传递,我们已经实现了肥皂服务,石英在骆驼路由器中,如下所示
public class BbdDmsBatchRoute extends RouteBuilder{
@BeanInject
private BbdImageProcessorBean bbdImageProcessorBean;
@BeanInject
private SwtDEAStockProcessorBean swtDEAStockProcessorBean;
@Value("${bbd.batch.enabled}")
private String isBatchEnabled;
@Value("${bbd.dmsStockBatch.interval}")
private String bbdDmsBatchInterval ;
private static final Logger LOG = LoggerFactory.getLogger(BbdDmsBatchRoute.class);
@Override
public void configure() throws Exception {
//***********Batch Job to get BBD images**************//
// This Batch Job will run based on time given in properties file for "bbd.batch.interval" property (bbd.batch.interval=0+0+12+1/1+*+?+*)
LOG.info("BBD Batch Job Cron expression {}",bbdDmsBatchInterval);
from("quartz2://STouchDmsBatch/bbdDailyJob?cron="+ bbdDmsBatchInterval)
.choice()
.when(simple(isBatchEnabled))
.doTry()
.bean(bbdImageProcessorBean, "bbdReRunDmsBatchInvocation")
.split(bodyAs(List.class)) //Split each object in list and process in parallel
//.executorServiceRef("executerRefProfile").parallelProcessing()
.to("direct:batchJobRouteUnitWork")
.end()
.endDoTry()
.doCatch(Exception.class)
.to("direct:BbdReRunError")
.end();
}
}
我想计算我的quartz2:StouchDmsBatch 被触发时的开始时间和路线无任何异常完成时的结束时间。
我红了几个例子,告诉使用camel拦截器,EventSupport等。 我想知道有没有人实施过同样的? 有人可以帮我吗?
【问题讨论】:
标签: spring apache-camel