java - executing multiple processing class with Spring batch processing -


I'm new to spring batch processing. Just wanted some suggestions so that I can join while reading about spring batch.

My scenario is as follows: I wrote 4 Java classes that read and modify data in Oracle. For example: Class 1 and Class 2 will modify Table 1, Class 3 and Class 4 to modify Table 2.

With spring batch processes, how can we parallel the execution of classes there?

Without knowing what each class does, I can provide a great range of advice, is. It is being said that, if you want to do all, then each class has to execute parallel using the spring batch, the spring batch provides some tools to help with this:

    < Li> Split - Split split flux in spring batch so that the steps can be executed in parallel. In your case, I expected that either two or four flows would be implemented in parallel (if you need to execute class 1 -> class 2 in sequence, but in the same order with class 3 -> class 4 Sequence is required, or if you can just walk all four squares in parallel).
  1. Method InvokingTaskletAdapter - This worksheet implementation provided by Spring Batch allows you to perform a task on a certain bean with a transaction You can wrap existing classes with the Tasklet so that they can easily consume from spring batch.

With the above concepts, you can configure your batch to see something like a job:

  & lt; Job ID = "Job 1" & gt; & Lt; Split id = "split1" & gt; & Lt; Flow & gt; & Lt; Step id = "split1step1" next = "split1step2" & gt; & Lt; Task ref = "class 1 tasket" /> & Lt; / Step & gt; & Lt; Phase ID = "Split 1 Phase 2" & gt; & Lt; Task ref = = "class 2 toket" /> & Lt; / Step & gt; & Lt; / Flow & gt; & Lt; Flow & gt; & Lt; Step id = "split2step1" next = "split2step2" & gt; & Lt; Task ref = "class 3 tasket" /> & Lt; / Step & gt; & Lt; Phase ID = "Split 2 Phase 2" & gt; & Lt; Task ref = = "square 4 toket" /> & Lt; / Step & gt; & Lt; / Flow & gt; & Lt; / Split & gt; & Lt; / Work & gt; & Lt; Bean id = "Class 1 taskbar" class = "org.springframework.batch.core.step.tasklet.MethodInvokingTaskletAdapter" & gt; & Lt; Property Name = "Target Object" & gt; & Lt; Bean square = "class 1" /> & Lt; / Property & gt; & Lt; Property Name = "Target Method" Value = "Some Method" /> & Lt; / Bean & gt; & Lt; Bean id = "Class 2 taskable" class = "org.springframework.batch.core.step.tasklet.MethodInvokingTaskletAdapter" & gt; & Lt; Property Name = "Target Object" & gt; & Lt; Bean square = "class 2" /> & Lt; / Property & gt; & Lt; Property Name = "Target Method" Value = "Some Method" /> & Lt; / Bean & gt; & Lt; Bean id = "Class 3 taskable" class = "org.springframework.batch.core.step.tasklet.MethodInvokingTaskletAdapter" & gt; & Lt; Property Name = "Target Object" & gt; & Lt; Bean square = "orbit 3" /> & Lt; / Property & gt; & Lt; Property Name = "Target Method" Value = "Some Method" /> & Lt; / Bean & gt; & Lt; Bean id = "square 4 taskable" class = "org.springframework.batch.core.step.tasklet.MethodInvokingTaskletAdapter"> & Lt; Property Name = "Target Object" & gt; & Lt; Bean square = "square 4" /> & Lt; / Property & gt; & Lt; Property Name = "Target Method" Value = "Some Method" /> & Lt; / Bean & gt;  

You can read more about the MethodInvokingTaskletAdapter in the document here:


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -