使用数据库中的Mule ESB进行大型数据集处理:如何根据一定的批次大小更新处理的记录? [英] Large dataset processing using Mule ESB from database: how to update the processed records based on certain batch size?

查看:256
本文介绍了使用数据库中的Mule ESB进行大型数据集处理:如何根据一定的批次大小更新处理的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大量记录要处理,例如:100,000条记录.我的用例有4个步骤:

I have a large set of records to be processed eg: 100,000 records. My use case has 4 steps:

  1. 使用jdbc入站适配器从数据库表中选择记录
  2. 将记录转换为xml格式
  3. 将消息发布到队列
  4. 然后使用已处理的状态标志更新同一条记录,以免再次被选择

我不想一次从表中挑出所有记录进行处理:是否有办法分批分批选择并且不想为一个记录更新表?可以在批次级别进行批量/批次更新吗?

I don't want to pick all the records from table at one shot for processing: is there a way so that pick in some batches and don't want to update table for one record? Is there any option of bulk/batch update at batch level?

或者还有其他更好的方法来处理此用例吗?任何建议,高度赞赏.

Or is there any other better way to approach this use case? Any suggestions highly appreciated.

推荐答案

我将编写SQL select查询以仅返回N条记录(如LIMIT 100或等效记录),并带有一个where子句,该子句根据该条件排除已处理的记录.状态标志.

I would write the SQL select query to return only N records (like LIMIT 100 or equivalent) with a where clause that excludes the already processed records based on the status flag.

这篇关于使用数据库中的Mule ESB进行大型数据集处理:如何根据一定的批次大小更新处理的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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