Package io.atomix.cluster.messaging
Class MessagingConfig
java.lang.Object
io.atomix.cluster.messaging.MessagingConfig
- All Implemented Interfaces:
Config
Messaging configuration.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe certificate chain to use for inter-cluster communication.intReturns the connection pool size.Returns the local interfaces to which to bind the node.getPort()Returns the local port to which to bind the node.booleansetCertificateChain(File certificateChain) Sets the certificate chain to use for inter-cluster communication.setInterfaces(List<String> interfaces) Sets the local interfaces to which to bind the node.Sets the local port to which to bind the node.setPrivateKey(File privateKey) Sets the private key of the certificate chain.setShutdownQuietPeriod(Duration shutdownQuietPeriod) Sets the shutdown quiet period.setShutdownTimeout(Duration shutdownTimeout) Sets the shutdown timeout.setTlsEnabled(boolean tlsEnabled) Sets whether or not to enable TLS for inter-cluster communication.
-
Constructor Details
-
MessagingConfig
public MessagingConfig()
-
-
Method Details
-
getInterfaces
Returns the local interfaces to which to bind the node.- Returns:
- the local interfaces to which to bind the node
-
setInterfaces
Sets the local interfaces to which to bind the node.- Parameters:
interfaces- the local interfaces to which to bind the node- Returns:
- this config for chaining
-
getPort
Returns the local port to which to bind the node.- Returns:
- the local port to which to bind the node
-
setPort
Sets the local port to which to bind the node.- Parameters:
port- the local port to which to bind the node- Returns:
- this config for chaining
-
getConnectionPoolSize
public int getConnectionPoolSize()Returns the connection pool size.- Returns:
- the connection pool size
-
getShutdownQuietPeriod
- Returns:
- the configured shutdown quiet period
-
setShutdownQuietPeriod
Sets the shutdown quiet period. This is mostly useful to set a small value when testing, otherwise every tests takes an additional 2 second just to shutdown the executor.- Parameters:
shutdownQuietPeriod- the quiet period on shutdown- Returns:
- this config for chaining
-
getShutdownTimeout
- Returns:
- the configured shutdown timeout
-
setShutdownTimeout
Sets the shutdown timeout.- Parameters:
shutdownTimeout- the time to wait for an orderly shutdown of the messaging service- Returns:
- this config for chaining
-
isTlsEnabled
public boolean isTlsEnabled()- Returns:
- true if TLS is enabled for inter-cluster communication
-
setTlsEnabled
Sets whether or not to enable TLS for inter-cluster communication.- Parameters:
tlsEnabled- true to enable TLS between all nodes, false otherwise- Returns:
- this config for chaining
-
getCompressionAlgorithm
-
setCompressionAlgorithm
-
getCertificateChain
The certificate chain to use for inter-cluster communication. This certificate is used for both the server and the client.- Returns:
- a file which contains the certificate chain
-
setCertificateChain
Sets the certificate chain to use for inter-cluster communication. If using a self-signed certificate, or one which is not widely trusted, this must be the complete chain.Mandatory if TLS is enabled.
- Parameters:
certificateChain- a file containing the certificate chain- Returns:
- this config for chaining
- Throws:
IllegalArgumentException- if the certificate chain is nullIllegalArgumentException- if the certificate chain points to a file which does not existIllegalArgumentException- if the certificate chain points to a file which cannot be read
-
getPrivateKey
- Returns:
- the private key of the certificate chain
-
setPrivateKey
Sets the private key of the certificate chain.Mandatory if TLS is enabled.
- Parameters:
privateKey- the private key of the associated certificate chain- Returns:
- this config for chaining
- Throws:
IllegalArgumentException- if the private key is nullIllegalArgumentException- if the private key points to a file which does not existIllegalArgumentException- if the private key points to a file which cannot be read
-