16.4. Distributed Task Failover
Red Hat JBoss Data Grid's distributed execution framework supports task failover in the following cases:
- Failover due to a node failure where a task is executing.
- Failover due to a task failure; for example, if a
Callable
task throws an exception.
The failover policy is disabled by default, and
Runnable
, Callable
, and DistributedCallable
tasks fail without invoking any failover mechanism.
JBoss Data Grid provides a random node failover policy, which will attempt to execute a part of a
Distributed
task on another random node if one is available.
A random failover execution policy can be specified using the following as an example:
Example 16.3. Random Failover Execution Policy
The
DistributedTaskFailoverPolicy
interface can also be implemented to provide failover management.
Example 16.4. Distributed Task Failover Policy Interface