0
votes

I'm dipping my toes into the microservices, is spring boot batch applicable to the following requirements?

  1. Files of one or multiple are read from a specific directory in Linux.
  2. Several operations like regex, build new files, write the file and ftp to a location
  3. Send email during a process fail

Using spring boot is confirmed, now the question is

  1. Should I use spring batch or just core spring framework?
  2. I need to integrate with Control-M to trigger the job. Can the Control-M be completely removed by using Spring batch library? As we don't know when to expect the files in the directory.

I've not seen a POC with these requirements. Would someone provide an example POC or an affirmation this could be achieved with Spring batch?

2
Spring batch could be part of the solution, depending on the size of and number of files being processed. If those parameters aren't large enough to justify batch I think Spring Integration would be an easy tool to implement a solution with. Configure integration flows that use pollers to check for the conditions that should trigger processing, and route the input to the appropriate endpoints. - Joe Chiavaroli

2 Answers

1
votes

I would use Spring Batch for that use case. Not only does it provide out of the box components for reading, processing, and writing files, it adds a lot more for error handling, scalability, etc. All of those things you'd probably end up wiring up by yourself if you go without Spring Batch.

As for being launched via Control-M, yes MANY large customers use Control-M to launch their jobs. Unfortunately, I've never done it myself so I cannot provide any details on the mechanics, but if Control-M can either launch a script or call a REST API, you can launch a job with it.

0
votes

I would suggest you, go for spring batch as it has much-inbuilt functionality which will be provided to you for file reading and writing to your required location. Even you will be able to handle record skipping requirement. Your mail triggering requirement will be handled by Control M. You just need to decide one exit code for your handled exception and on the basis of that exit code you can trigger the mail to respective members. And there are many other features which will be helpful if you go for spring batch.