This repository contains a collection of code examples for Hekate.io project.
All examples are organized as a single module Maven project that produces multiple build artifacts (one per example). Each such artifact is a self-contained Spring Boot application that can easily be copied to multiple hosts.
- Latest stable Java SDK (8, 11, 17)
cd
to the project's root folder- run
./mvnw clean package
cd
to the project's/target
folder- run
java -jar <example-jar>
where<example-jar>
is the name of the example jar file
For example:
java -jar hekate-example-cluster-view.jar
java -jar hekate-example-distributed-lock.jar
- etc...
All examples use the same application.yml configuration file (Spring Boot YAML format).
This file gets automatically included into all of the jar-files at build time. It is possible to override configuration properties by specifying an external configuration file as described in Spring Boot's documentation.
hekate-example-cluster-listener.jar
(source code) - An example which shows how to implement a simple listener of cluster eventshekate-example-cluster-view.jar
(source code) - An example which shows how to build different cluster views based on dynamic filtering of the cluster topologyhekate-example-cluster-future.jar
(source code) - An example which shows how to register a cluster topology condition and get a notification once it is met
hekate-example-rpc-request.jar
(source code) - A simple example of request/response RPCshekate-example-rpc-agregate.jar
(source code) - An example of how to submit an RPC request to all cluster nodes and how to aggregate RPC resultshekate-example-rpc-split-agregate.jar
(source code) - An example of how to perform a Map/Reduce style of RPC communications
hekate-example-distributed-lock.jar
(source code) - An example of how to use distributed locks
hekate-example-election.jar
(source code) - An example of how to use Hekate election service to implement a cluster-wide singleton
hekate-example-messaging-request.jar
(source code) - A simple example of request/response messaginghekate-example-messaging-aggregate.jar
(source code) - An example of how to submit a message to all cluster nodes and how to aggregate their responseshekate-example-messaging-broadcast.jar
(source code) - A simple example of broadcast messaging