Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Discovering if Workers are Available

With regards to the Master-Worker pattern, is there a generic solution to discover if (and how many) workers are available to process Tasks? With the GigaSpace API, I can both discover if the space is running and record a variety of admin statistics, but I would also like to detemine if workers have been started before submitting tasks to the space.

Thanks in advance.

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2138]{quote}

asked 2007-05-12 12:48:01 -0500

updated 2013-08-08 09:52:00 -0500

jaissefsfex's avatar
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

When having the workers running within the spaces (IWorkers implementation that is the preferred architecture which provide the best performance , latency and scalability) ? there is no need to determine if worker is available. If the space exists the worker exists.

When workers running out-side the space in a separate VM , you may use the lease mechanism to determine the existence of the workers.
See example:
See how the command object lease renewed at the worker. This allows the master to count the amount of command objects within the space to send into the space more tasks per job. You can use the same mechanism to determine is a worker exists.
You may want to use the LeaseRenewalManager to maintain the worker lease in implicit manner:

When workers deployed as Service Beans into the Service Grid ? you may use Service Events. See:


answered 2007-05-12 13:27:02 -0500

shay hassidim's avatar
edit flag offensive delete link more


Thanks for the quick response, Shay.

We probably do not want to run the workers in embedded mode since the tasks are intensive/expensive. That is, it makes more sense for us to share a common space with multiple workers where each worker is running on a separate machine.

As far as I can tell from the following post, we will not be restricted from doing this with the Community Edition, right?


That being said, I'll have a look at the links regarding the lease mechanism you sent.

kirandkeshav's avatar kirandkeshav  ( 2007-05-12 13:52:01 -0500 )edit

There is no problem running workers on different machines when using the community edition. You can have workers running on separate machines accessing the space in remote mode on different machine when using the community edition.

You will not have high-availability for the space nor dynamic scalability for the space/workers or any central deployment and management tools as the enterprise edition provides. You will need to build all these yourself.


shay hassidim's avatar shay hassidim  ( 2007-05-12 18:11:02 -0500 )edit

Great, thanks.

"Discovering workers" by the client works well with the master-worker example you provided in the Enterprise Edition.

Kind Regards,


kirandkeshav's avatar kirandkeshav  ( 2007-05-12 19:47:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2007-05-12 12:48:01 -0500

Seen: 218 times

Last updated: May 12 '07