Reputation: 1458
I have a dashboard where users can do modification to their customers datas. Some modifications needs heavy processing on all those customers. I don't want to block my user waiting that the task finished so how can I manage this in background?
I saw Spring Batch but I'm not sure it's the good answer. Is there anything else?
Thanks in advance for your help.
Upvotes: 0
Views: 553
Reputation: 11363
You already have an accepted answer, but I wanted to throw in another option FYI.
Upvotes: 0
Reputation: 608
You should have a separte process or application to process this kind of heavy task. Your main application have to communicate with this heavy-task-processor via any method like JMS, JGroups, ConcurrentLinkedQueue, or whatever you want. You can process (deque) each task one at time or using a thread pool. When the task is finish you have to implement a way to inform the main application the task has finished (JMS, subscription, etc..)
Upvotes: 0
Reputation: 9872
It is not a Spring specific feature, but if you work under a commercial java application server (say websphere, weblogic), you will have some implementation of workmanagers.
http://docs.oracle.com/javaee/1.4/api/javax/resource/spi/work/WorkManager.html
These are container-managed threadpools used to send work into the background. You will find tools in your admin console to configure and fine tune them.
Upvotes: 0