Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
392 views
in Technique[技术] by (71.8m points)

jdbc - Large dataset processing using Mule ESB from database: how to update the processed records based on certain batch size?

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

  1. pick the records from database table using jdbc inbound adapter
  2. convert the record to xml format
  3. post the message to the queue
  4. then update the same record with some status flag as it has been processed so that it will not be picked again

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...