为每个民意调查获取特定的记录集,而无需在骆驼中设置标志 [英] fetch specific set of records for each poll without setting the flag in camel
本文介绍了为每个民意调查获取特定的记录集,而无需在骆驼中设置标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从数据库中挑选所有消息并将其发送以进行重新处理.
I need to pick all the messages from db and send it for reprocessing.
我的主要要求是
- 我应该为每次投票只获取特定数量的记录,而不是所有记录.
- 下一次轮询应该为我获取下一组记录并将其设置为处理.
- 我不应该在表中使用 processingFlag 列 - 这是不允许的.
我可以随意使用任何camel组件,例如jpa、sql、jdbc等,
I am free to use any camel component such as jpa, sql , jdbc etc.,
非常感谢您的帮助.
推荐答案
添加诸如 processedFlag
之类的触发变量绝对是最简单的方法.最初这个变量被设置为null
.
Adding a trigger variable such as processedFlag
is definitely the simplest way to go. Initially this variable is set to null
.
程序:
- 选择
obj.processedFlag 不为空的所有记录
. - 处理记录.
- 处理后,将
obj.processedFlag
设置为一个值≠null
. - 从 1 开始.
- Select all records where
obj.processedFlag is not null
. - Process the record.
- After processing, set
obj.processedFlag
to a value ≠null
. - Begin at 1.
我猜不使用触发变量只会产生相当多的头痛.
Not using a trigger variable would only produce a fair amount of headaches, I guess.
这篇关于为每个民意调查获取特定的记录集,而无需在骆驼中设置标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文