Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6617769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:44:37+00:00 2026-05-25T20:44:37+00:00

I need advise regarding the pattern to use for the following problem. There are

  • 0

I need advise regarding the pattern to use for the following problem.

There are many rows — let us call it messages(identified by MSG_ID in DB)– in a table which corresponds to a file. Means, the file has been split into many pieces and put into database.

So parts corresponding to file can be identified using a GROUP_ID column, and MSG_ID corresponds to individual message. The primary key is a combination of GROUP_ID and MSG_ID.

Now, each message consists of n number of logical records(which are typically payment instructions(k x 128 bytes of data)). Where current reading payment instruction ends can be said only after reading the next 128 characters. Also parts of a payment instruction can be in consecutive messages. Which means a complete payment instruction can be spread across end of MSG_ID n and start of MSG_ID n+1.

We are using spring batch to do the processing.

I have tried querying the table and writing all the records to a flat file one by one and start the spring batch from there.

I would like to know whether there’s any pattern which I can use to achieve the requirement without using a flat file.

Like,

  1. Read MSG_ID 1 and GROUP_ID “ABC” from db

  2. Seperate the payment instructions and give each instruction to the processor.

  3. When end of MSG_ID 1 is reached check whether the final record in hand form a Payment Instruction, if not read MSG_ID 2 and GROUP_ID “ABC” and append to the previous left over record.

  4. Read till MSG_ID==N where N is known before starting the read process.

  5. Is there any ItemReaders in Spring or Iterator patterns in java which I can use ?

To be more clear, there are patterns for handling, “IF your logical record is spread in multiple rows”. Is there any pattern for “IF one row in DB contains ‘M’ number logical records, where M may not be an integer, use this type of Iterator or ItemReaders”

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:44:38+00:00Added an answer on May 25, 2026 at 8:44 pm

    I believe you should write a custom Reader (processing logic) for your scenario. It certainly doesn’t seem as a common case.

    The algorithm you proposed seems OK. You should have no trouble writing a Reader which reads a complete payment instruction and hands it off for further processing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some advice regarding the use of a command line utility from a
I need some clarification/advice regarding modifying objects stored in mutable containers in Objective-C. Let's
I need to develop some kind of application and use DB in it. Let's
I need advice regarding subselect performance in MySQL. For a reason that I can't
I am working on a project with zend framework and i need your advise
I need an opinion and advise from experienced ASP.NET people, what way to go.
I need to display a progress of loading of item's children. Please advise how
I need advice on the following HTML: <!-- Beginning of ROW !--> <div id="row1">
I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with
I really need advice on how to do the following. I have tried several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.