Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Batch - Clustered Environment - Failover mechanism

Question: What is the failover strategy that spring batch supports best? Resource usage, failover mechanism have to be focussed on. Any suggestions?

Usecase - Spring batch has to be run to read a file(that will be put on the server by another application) from the server and process it.

Environment is clustered. So, there could be multiple server instances that could trigger the batch jobs trying to read the same file on arrival.

My thoughts: Polling can be done to check the arrival of the file and call the spring batch job. Since it is clustered, we could use active/passive strategy to poll. The other types such as roundrobin or time slicing can also be used.

Pardon me if I am not clear. I can explain if something is unclear.

like image 271
Sunil Avatar asked Mar 28 '13 07:03

Sunil


1 Answers

As I understand from here

http://static.springsource.org/spring-batch/reference/html/scalability.html

the better approach would be to have just one poller and than distribute the job to the cluster through one of the mechanisms provided by spring Batch (I think the one named Remote Chunks is the best choice here).

I don't think you should worry about the clustering strategy as this is handled either by Spring Batch or by other clustering distribution mechanisms.

like image 83
cornel rebegea Avatar answered Oct 06 '22 00:10

cornel rebegea