Use the Atoti Starter
In a Spring application, the different components used in distribution like the messenger will be automatically created by Atoti starter for Spring Bootcom.activeviam.springboot:atoti-server-starter. Import this dependency in your project to perform this injection.In the context of tests, Atoti comes with the class
com.activeviam.atoti.server.test.api.DistributionTestHelper handling this setup. See the specific section for details about its setup and usage.
Configure your application
The first step to define an application is to define a database. This is done like in a non-distributed application (see Database Overview) The second step is to define the data nodes and the query nodes. Here as an example of a data node definition:withLocalMessenger or the withNettyMessenger methods.
This is the moment to conceal the hierarchies or the branches if it applies here (see Recommendations)
And of a query node definition:
Join/Leave a cluster
It is possible to join and leave the cluster programmatically like this:ServiceUnavailableException is thrown.