Interface ClusterDiscoveryCallback
-
public interface ClusterDiscoveryCallback
This callback is meant to regularly discover the addresses of all available HiveMQ cluster nodes.Note: Extension discovery is only used by HiveMQ if
<discovery>
is set to<extension>
in the<cluster>
section of the HiveMQ config file.- Since:
- 4.0.0, CE 2019.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy(@NotNull ClusterDiscoveryInput clusterDiscoveryInput)
This method is called once by HiveMQ in one of the following cases: This callback is removed viaClusterService.removeDiscoveryCallback(ClusterDiscoveryCallback)
The extension which added the callback is stopped The HiveMQ instance is shut downvoid
init(@NotNull ClusterDiscoveryInput clusterDiscoveryInput, @NotNull ClusterDiscoveryOutput clusterDiscoveryOutput)
This method is called once by HiveMQ when this callback is added viaClusterService.addDiscoveryCallback(ClusterDiscoveryCallback)
.void
reload(@NotNull ClusterDiscoveryInput clusterDiscoveryInput, @NotNull ClusterDiscoveryOutput clusterDiscoveryOutput)
This method is called regularly by HiveMQ to discover all current available cluster nodes.
-
-
-
Method Detail
-
init
void init(@NotNull ClusterDiscoveryInput clusterDiscoveryInput, @NotNull ClusterDiscoveryOutput clusterDiscoveryOutput)
This method is called once by HiveMQ when this callback is added viaClusterService.addDiscoveryCallback(ClusterDiscoveryCallback)
.It can be used to register this HiveMQ instance with some kind of central registry or to save it to a database or file server for example.
- Parameters:
clusterDiscoveryInput
- The object providing input information for cluster discovery.clusterDiscoveryOutput
- The object for providing output information for cluster discovery, e.g. the addresses of all HiveMQ cluster nodes.- Since:
- 4.0.0, CE 2019.1
-
reload
void reload(@NotNull ClusterDiscoveryInput clusterDiscoveryInput, @NotNull ClusterDiscoveryOutput clusterDiscoveryOutput)
This method is called regularly by HiveMQ to discover all current available cluster nodes.The interval between calls to this method is 60 seconds by default and can be overwritten by an individual
ClusterDiscoveryCallback
viaClusterDiscoveryOutput.setReloadInterval(int)
.- Parameters:
clusterDiscoveryInput
- The object providing input information for cluster discovery.clusterDiscoveryOutput
- The object for providing output information for cluster discovery, e.g. the addresses of all HiveMQ cluster nodes.- Since:
- 4.0.0, CE 2019.1
-
destroy
void destroy(@NotNull ClusterDiscoveryInput clusterDiscoveryInput)
This method is called once by HiveMQ in one of the following cases:- This callback is removed via
ClusterService.removeDiscoveryCallback(ClusterDiscoveryCallback)
- The extension which added the callback is stopped
- The HiveMQ instance is shut down
It can be used to unregister this HiveMQ instance from a central registry.
- Parameters:
clusterDiscoveryInput
- The object providing input information for cluster discovery.- Since:
- 4.0.0, CE 2019.1
- This callback is removed via
-
-