-
-
Notifications
You must be signed in to change notification settings - Fork 0
ClusterReadyEvent description
Leonid edited this page Jun 15, 2020
·
1 revision
Cluster have set of nodes hosted on different hosts.
Nodes are entering cluster not at the same time but Ignite allows you to use cluster even when not all nodes in the cluster exists, and some of them maybe failed to start.
In this situation when you want to use cluster only if all nodes successfully started you should listen to ClusterReadyEvent
When all nodes entered the cluster and cluster is ready for tasks, ClusterReadyEvent fires on every node of the cluster.
@Slf4j
@Service
@RequiredArgsConstructor
public class ClusterReadyConsumer implements ApplicationListener<ClusterReadyEvent> {
private final Cluster cluster;
@Override
public void onApplicationEvent(@NotNull ClusterReadyEvent event) {
log.info("Cluster is ready: {}", event);
}
}
- example-01 - cluster ready event, self-registered repositories
- example-02 - run Spring bean as a cluster task
- example-03 - chain running
- example-04 - chain running with audit