1

We have one file processing job where we read the file in step 1, then in step 2 we call stored procedure for some data processing and in step 3 we clean data.

We are using spring integration to poll for message which contain the file name and path and some other info.

Once message is received, it launches the job using job launching gateway along with job parameters.

What I like to know is, if the job is started with say for eg thread-1 then does that same thread finish all the 3 steps or spring batch might switch the thread and finish with other thread.

Note : we are not using multithreading in our job. It is very basic job with 3 steps.

user509755
  • 2,941
  • 10
  • 48
  • 82

2 Answers2

0

It should just be using one thread.

leeor
  • 17,041
  • 6
  • 34
  • 60
0

There are is lot of "depends on your configuration" potential here.

You say that you are using Spring Integration to launch your batch job. I am assuming you are using the <int-file:inbound-channel-adapter> with a configured poller? If that is true and you are relying on default configurations, it will be polling/processing with a single thread.

Furthermore, assuming you are not explicitly multi-threading in your Spring Integration flow (between the file input and calling the batch job), default channels and endpoints are all also single-threaded.

Once your batch job is launched, again it depends on your job configuration as to whether or not it is multi-threaded. From the sounds of your question you do not explicitly multi-thread your job. By default it will be single-threaded.


For the most part, if you have not configured a custom TaskExecutor anywhere in your Spring configuration; you can pretty safely assume everything is multi-threaded.

FGreg
  • 14,110
  • 10
  • 68
  • 110
  • In case you are interested in the different ways of "multi-threading" your batch processes: http://stackoverflow.com/a/29108483/953327 – FGreg Oct 12 '15 at 22:49