Simple Cluster

One an application has been written to use the JatheClient, it can be turned into a clustered application by staring up Executive instances with the same cluster name. For example, start a MainExecutive class running in it's own process:

        java -jar jather-<version>.jar

This will start an Executive running with an output similar to:

18:49:14,711  INFO MainExecutive:124 - Using slots:10
18:49:14,714  INFO MainExecutive:125 - Using max group size:-1
18:49:14,715  INFO MainExecutive:126 - Using channel name:Jather
18:49:14,715  INFO MainExecutive:127 - Using channel props:null
18:49:14,716  INFO MainExecutive:129 - Using channel URL props:null

...
 ---------------------------------------------------------
 GMS: address is 192.168.10.10:39474 (cluster=Jather)
 ---------------------------------------------------------

This shows an Executive instance is running with 10 slots, using default JChannel settings and connected to the cluster named 'Jather'.

Now the cluster can be used by running the MainSubmitClient in a separate process. This should give the following similar output from the client process.

...
 ---------------------------------------------------------
 GMS: address is 192.168.10.10:47915 (cluster=Jather)
 ---------------------------------------------------------
...
 ---------------------------------------------------------
 GMS: address is 192.168.10.10:35813 (cluster=Jather)
 ---------------------------------------------------------
1,2,4,5,8,10,20,25,40,50,100,125,200,250,500,1000,
1,2,4,5,8,10,20,25,40,50,100,125,200,250,500,1000,
1,2,4,5,8,10,20,25,40,50,100,125,200,250,500,1000,
1,2,4,5,8,10,20,25,40,50,100,125,200,250,500,1000,
1,2,4,5,8,10,20,25,40,50,100,125,200,250,500,1000,

While the output of the MainExecutive will show the process output.

...
1000) adding factor...1
1000) adding factor...2
1000) adding factor...4
1000) adding factor...5
1000) adding factor...8
1000) adding factor...10
1000) adding factor...20
1000) adding factor...25
1000) adding factor...40
1000) adding factor...50
1000) adding factor...100
...

This process shows how the client application is not being executed in clustered processes, through just string new MainExecutive instances. To see a larger cluster in operation, just start more MainExecutive instances.

Note: that the Executive process class path did not include the new classes, and did not include the MyCallable class that was executed. This is because the Executive instances use a local ClassLoader per Callable instance that will retrieve the required classes from the ClassLoader of the JatherClient context.