我的骆驼:
<from uri="quartz2://processTimers?cron=5+*+*+*+*+*" />
<to uri="mybatis:selectProducts?statementType=SelectList&onConsume=consumeProduct"/>
<bean ref="productService" method="process" />
<to uri="mq:queue:my.queue"/>当使用Quartz from时,selectProducts返回预期的结果,但某些onConsume在结束时不执行,我怀疑这是因为它是一个"to“而不是"from”方法。
有没有使用onConsume的cron调度mybatis select?
更新:
<from uri="mybatis:selectProducts?statementType=SelectList&onConsume=markProductAsExtracted&maxMessagesPerPoll={{MAX_RECORDS_PER_PROCESS}}&scheduler=quartz2&scheduler.cron=5+*+*+*+*+?"/>
<bean ref="productService" method="process" />
<to uri="mq:queue:my.queue"/>发布于 2017-03-24 16:51:10
是的,请参阅计划的轮询消费者:http://camel.apache.org/polling-consumer.html
您可以在mybatis端点上指定调度程序为cron,然后设置cron值。有关更多详细信息,请参阅该文档。
我还写了一个小博客:http://www.davsclaus.com/2013/08/apache-camel-212-even-easier-cron.html,它是关于文件组件的,但它对mybatis也是一样的。
https://stackoverflow.com/questions/42982473
复制相似问题