Worker Processes - org-z2env-worker » History » Revision 2
« Previous |
Revision 2/6
(diff)
| Next »
Henning Blohm, 26.08.2015 15:00
Worker Processes (org.z2env.worker)¶
A worker process component, when prepared starts a new z2 Java process that keeps running until stopped or some configured Runnable or Main class completes.
The point in using worker process components is that this allows you to configure process configuration such as heap size via a component declaration in a central repository rather than using some scripting rules. Also, when using worker processes, the home process can be used to make sure actual application processes get restarted, in case of process crashes. Finally, in nontrivial and distributed scenarios, where a number of different node types are required, starting any combination of those from a single home process makes scale out configuration simple and robust.
A worker process component is declared by specifying some process configuration and some target states, e.g. like this:
org.z2env.component.type=org.z2env.worker
worker.process.vmOptions=-Xmx1024M
worker.states=mymodule/workerUp
or like this, in case the component mymodule/main is a main component or supplies a Runnable.
org.z2env.component.type=org.z2env.worker
worker.process.vmOptions=-Xmx1024M
worker.states=mymodule/workerUp
worker.main=mymodule/main
Updated by Henning Blohm over 9 years ago · 2 revisions