取一组特定的每个调查记录,而不在骆驼设置标志 [英] fetch specific set of records for each poll without setting the flag in camel

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

问题描述

我需要从数据库挑选的所有信息,并将其发送进行加工处理。

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

我的主要要求是


  1. 我应该只获取一定数量的每个投票记录,而不是所有的记录。

  2. 下一次民意调查应该得到我的下一组记录,并将其设置进行处理。

  3. 我不应该在表中使用processedFlag列 - 这是不允许

我可以自由使用任何骆驼组件,如JPA,SQL,JDBC等,

I am free to use any camel component such as jpa, sql , jdbc etc.,

帮助是极大的AP preciated。

Help is greatly appreciated.

推荐答案

添加一个触发变量,如 processedFlag 是肯定要走的最简单方法。最初,这个变量被设置为

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 为值NE;

  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天全站免登陆