Apache camel ApacheCamel-Quartz2与mybatis一起使用onConsume

Apache camel ApacheCamel-Quartz2与mybatis一起使用onConsume,apache-camel,Apache Camel,我的骆驼: <from uri="quartz2://processTimers?cron=5+*+*+*+*+*" /> <to uri="mybatis:selectProducts?statementType=SelectList&amp;onConsume=consumeProduct"/> <bean ref="productService" method="process" /> <to uri="mq:queue:my.queue"

我的骆驼:

<from uri="quartz2://processTimers?cron=5+*+*+*+*+*" />
<to uri="mybatis:selectProducts?statementType=SelectList&amp;onConsume=consumeProduct"/>
<bean ref="productService" method="process" />
<to uri="mq:queue:my.queue"/>

当使用Quartz from时,selectProducts会返回预期结果,但某些产品的onConsume最终不会执行,我怀疑这是因为它是“to”而不是“from”方法

是否有一个带有onConsume的cron scheduled mybatis select

更新:

<from uri="mybatis:selectProducts?statementType=SelectList&amp;onConsume=markProductAsExtracted&amp;maxMessagesPerPoll={{MAX_RECORDS_PER_PROCESS}}&amp;scheduler=quartz2&amp;scheduler.cron=5+*+*+*+*+?"/>
<bean ref="productService" method="process" />
<to uri="mq:queue:my.queue"/>

是请参见计划轮询消费者:

您可以在mybatis端点上指定调度程序为cron,然后设置cron值。更多详情请参见该文档


还有一次我写了一个小博客:关于文件组件,但对mybatis也是一样。

好吧,但我想让cron每天运行一次,然后mybatis轮询X条消息,如果超过X条消息,它会一直拉消息,直到没有更多消息为止。似乎你建议的是每次民意测验只运行一次cron,而不是多次民意测验运行一次。