为每次轮询获取特定的记录集,而不在骆驼中设置标志 [英] fetch specific set of records for each poll without setting the flag in camel

查看:9
本文介绍了为每次轮询获取特定的记录集,而不在骆驼中设置标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从 db 中挑选所有消息并将其发送以进行重新处理.

I need to pick all the messages from db and send it for reprocessing.

我的主要要求是

  1. 我应该为每次投票只获取一定数量的记录,而不是所有记录.
  2. 下一次民意调查应该让我获得下一组记录并将其设置为处理.
  3. 我不应该使用表中的 processesFlag 列 - 这是不允许的.

我可以随意使用jpa、sql、jdbc等任何camel组件,

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.

程序:

  1. 选择 obj.processedFlag 不为空的所有记录.
  2. 处理记录.
  3. 处理后,将 obj.processedFlag 设置为值 ≠null.
  4. 从 1 点开始.
  1. Select all records where obj.processedFlag is not null.
  2. Process the record.
  3. After processing, set obj.processedFlag to a value ≠ null.
  4. Begin at 1.

我猜,不使用触发变量只会让人头疼.

Not using a trigger variable would only produce a fair amount of headaches, I guess.

这篇关于为每次轮询获取特定的记录集,而不在骆驼中设置标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆