Class EventBusOptions
java.lang.Object
io.vertx.core.net.NetworkOptions
io.vertx.core.net.TCPSSLOptions
io.vertx.core.eventbus.EventBusOptions
Options to configure the event bus.
- Author:
- Clement Escoffier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default accept backlog = 1024static final ClientAuthDefault value of whether client auth is required (SSL/TLS) = Nostatic final StringThe default cluster host = null which means use the same as the cluster manager, if possible.static final longThe default value of cluster ping interval = 20000 ms.static final longThe default value of cluster ping reply interval = 20000 ms.static final intThe default cluster port = 0 which means assign a random port.static final StringThe default cluster public host = null which means use the same as the cluster host.static final intThe default cluster public port = -1 which means use the same as the cluster port.static final intThe default value of connect timeout = 60000 msstatic final intThe default value for reconnect attempts = 0static final longThe default value for reconnect interval = 1000 msstatic final booleanThe default value of whether all servers (SSL/TLS) should be trusted = trueFields inherited from class TCPSSLOptions
DEFAULT_IDLE_TIMEOUT, DEFAULT_IDLE_TIMEOUT_TIME_UNIT, DEFAULT_READ_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_CORK, DEFAULT_TCP_FAST_OPEN, DEFAULT_TCP_KEEAPLIVE_COUNT, DEFAULT_TCP_KEEAPLIVE_IDLE_SECONDS, DEFAULT_TCP_KEEAPLIVE_INTERVAL_SECONDS, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_TCP_QUICKACK, DEFAULT_TCP_USER_TIMEOUT, DEFAULT_WRITE_IDLE_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofEventBusOptionsusing the default configuration.EventBusOptions(EventBusOptions other) Copy constructor to create an instance ofEventBusOptionsusing the values of the given object.EventBusOptions(JsonObject json) Creates a new instance ofEventBusOptionsfrom the JSON object. -
Method Summary
Modifier and TypeMethodDescriptionaddCrlPath(String crlPath) Add a CRL pathaddCrlValue(Buffer crlValue) Add a CRL valueaddEnabledCipherSuite(String suite) Add an enabled cipher suite, appended to the ordered suites.addEnabledSecureTransportProtocol(String protocol) Add an enabled SSL/TLS protocols, appended to the ordered protocols.intUser-supplied information about this node when Vert.x is clustered.longGet the value of cluster ping reply interval, in ms.longGet the value of cluster ping reply interval, in ms.Get the public facing host to be used when clustering.intGets the public facing port to be used when clustering.intgetHost()intgetPort()intlongbooleanremoveEnabledCipherSuite(String suite) Removes an enabled cipher suite from the ordered suites.removeEnabledSecureTransportProtocol(String protocol) Removes an enabled SSL/TLS protocol from the ordered protocols.setAcceptBacklog(int acceptBacklog) Set the accept back log.setClientAuth(ClientAuth clientAuth) Set whether client auth is requiredsetClusterNodeMetadata(JsonObject clusterNodeMetadata) Set information about this node when Vert.x is clustered.setClusterPingInterval(long clusterPingInterval) Set the value of cluster ping interval, in ms.setClusterPingReplyInterval(long clusterPingReplyInterval) Set the value of cluster ping reply interval, in ms.setClusterPublicHost(String clusterPublicHost) Set the public facing hostname to be used for clustering.setClusterPublicPort(int clusterPublicPort) SeesetClusterPublicHost(String)for an explanation.setConnectTimeout(int connectTimeout) Sets the connect timeoutsetEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols) Sets the list of enabled SSL/TLS protocols.Sets the host.setIdleTimeout(int idleTimeout) Set the idle timeout, default time unit is seconds.setIdleTimeoutUnit(TimeUnit idleTimeoutUnit) Set the idle timeout unit.setKeyCertOptions(KeyCertOptions options) Set the key/cert options.setLogActivity(boolean logEnabled) Set to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.setPort(int port) Sets the port.setReadIdleTimeout(int idleTimeout) Set the read idle timeout, default time unit is seconds.setReceiveBufferSize(int receiveBufferSize) Set the TCP receive buffer sizesetReconnectAttempts(int attempts) Sets the value of reconnect attempts.setReconnectInterval(long interval) Set the reconnect interval.setReuseAddress(boolean reuseAddress) Set the value of reuse addresssetReusePort(boolean reusePort) Set the value of reuse port.setSendBufferSize(int sendBufferSize) Set the TCP send buffer sizesetSoLinger(int soLinger) Set whether SO_linger keep alive is enabledsetSsl(boolean ssl) Set whether SSL/TLS is enabledsetSslEngineOptions(SSLEngineOptions sslEngineOptions) Set to use SSL engine implementation to use.setSslHandshakeTimeout(long sslHandshakeTimeout) Set the SSL handshake timeout, default time unit is seconds.setSslHandshakeTimeoutUnit(TimeUnit sslHandshakeTimeoutUnit) Set the SSL handshake timeout unit.setTcpCork(boolean tcpCork) Enable theTCP_CORKoption - only with linux native transport.setTcpFastOpen(boolean tcpFastOpen) Enable theTCP_FASTOPENoption - only with linux native transport.setTcpKeepAlive(boolean tcpKeepAlive) Set whether TCP keep alive is enabledsetTcpNoDelay(boolean tcpNoDelay) Set whether TCP no delay is enabledsetTcpQuickAck(boolean tcpQuickAck) Enable theTCP_QUICKACKoption - only with linux native transport.setTcpUserTimeout(int tcpUserTimeout) Sets theTCP_USER_TIMEOUToption - only with linux native transport.setTrafficClass(int trafficClass) Set the value of traffic classsetTrustAll(boolean trustAll) Set whether all server certificates should be trusted.setTrustOptions(TrustOptions options) Set the trust options.setUseAlpn(boolean useAlpn) Set the ALPN usage.setWriteIdleTimeout(int idleTimeout) Set the write idle timeout, default time unit is seconds.toJson()Builds a JSON object representing the currentEventBusOptions.Methods inherited from class TCPSSLOptions
createSSLOptions, getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getKeyCertOptions, getOrCreateSSLOptions, getReadIdleTimeout, getReceiveBufferSize, getSendBufferSize, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, getSslOptions, getTcpKeepAliveCount, getTcpKeepAliveIdleSeconds, getTcpKeepAliveIntervalSeconds, getTcpUserTimeout, getTrafficClass, getTransportOptions, getTrustOptions, getWriteIdleTimeout, isReuseAddress, isReusePort, isSsl, isTcpCork, isTcpFastOpen, isTcpKeepAlive, isTcpNoDelay, isTcpQuickAck, isUseAlpn, setTcpKeepAliveCount, setTcpKeepAliveIdleSeconds, setTcpKeepAliveIntervalSecondsMethods inherited from class NetworkOptions
getActivityLogDataFormat, getLogActivity, setActivityLogDataFormat
-
Field Details
-
DEFAULT_CLUSTER_HOST
The default cluster host = null which means use the same as the cluster manager, if possible. -
DEFAULT_CLUSTER_PORT
public static final int DEFAULT_CLUSTER_PORTThe default cluster port = 0 which means assign a random port.- See Also:
-
DEFAULT_CLUSTER_PUBLIC_HOST
The default cluster public host = null which means use the same as the cluster host. -
DEFAULT_CLUSTER_PUBLIC_PORT
public static final int DEFAULT_CLUSTER_PUBLIC_PORTThe default cluster public port = -1 which means use the same as the cluster port.- See Also:
-
DEFAULT_CLUSTER_PING_INTERVAL
public static final long DEFAULT_CLUSTER_PING_INTERVALThe default value of cluster ping interval = 20000 ms. -
DEFAULT_CLUSTER_PING_REPLY_INTERVAL
public static final long DEFAULT_CLUSTER_PING_REPLY_INTERVALThe default value of cluster ping reply interval = 20000 ms. -
DEFAULT_ACCEPT_BACKLOG
public static final int DEFAULT_ACCEPT_BACKLOGThe default accept backlog = 1024- See Also:
-
DEFAULT_CLIENT_AUTH
Default value of whether client auth is required (SSL/TLS) = No -
DEFAULT_RECONNECT_ATTEMPTS
public static final int DEFAULT_RECONNECT_ATTEMPTSThe default value for reconnect attempts = 0- See Also:
-
DEFAULT_RECONNECT_INTERVAL
public static final long DEFAULT_RECONNECT_INTERVALThe default value for reconnect interval = 1000 ms- See Also:
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUTThe default value of connect timeout = 60000 ms- See Also:
-
DEFAULT_TRUST_ALL
public static final boolean DEFAULT_TRUST_ALLThe default value of whether all servers (SSL/TLS) should be trusted = true- See Also:
-
-
Constructor Details
-
EventBusOptions
public EventBusOptions()Creates a new instance ofEventBusOptionsusing the default configuration. -
EventBusOptions
Copy constructor to create an instance ofEventBusOptionsusing the values of the given object.- Parameters:
other- the otherEventBusOptions
-
EventBusOptions
Creates a new instance ofEventBusOptionsfrom the JSON object. This JSOn object has (generally) be generated usingtoJson().- Parameters:
json- the json object
-
-
Method Details
-
toJson
Builds a JSON object representing the currentEventBusOptions.- Overrides:
toJsonin classTCPSSLOptions- Returns:
- the JSON representation
-
getClientAuth
- Returns:
- the configure client authentication requirement
- See Also:
-
setClientAuth
Set whether client auth is required- Parameters:
clientAuth- One of "NONE, REQUEST, REQUIRED". If it's set to "REQUIRED" then server will require the SSL cert to be presented otherwise it won't accept the request. If it's set to "REQUEST" then it won't mandate the certificate to be presented, basically make it optional.- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
getAcceptBacklog
public int getAcceptBacklog()- Returns:
- the value of accept backlog.
- See Also:
-
setAcceptBacklog
Set the accept back log.- Parameters:
acceptBacklog- accept backlog- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
getHost
- Returns:
- the host or
nullif the clustered eventbus should try to pick one automatically
-
setHost
Sets the host. Defaults tonull.When the clustered eventbus starts, it tries to bind to the provided
host. Ifhostisnull, then it tries to bind to the same host as the underlying cluster manager. As a last resort, an address will be picked among the available network interfaces.- Parameters:
host- the host- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
getPort
public int getPort()- Returns:
- the port, which can be configured from the
setPort(int), or using the--cluster-portcommand line option. - See Also:
-
setPort
Sets the port.- Parameters:
port- the port- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
getReconnectAttempts
public int getReconnectAttempts()- Returns:
- the value of reconnect attempts
- See Also:
-
setReconnectAttempts
Sets the value of reconnect attempts.- Parameters:
attempts- the maximum number of reconnect attempts- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
getReconnectInterval
public long getReconnectInterval()- Returns:
- the value of reconnect interval
- See Also:
-
setReconnectInterval
Set the reconnect interval.- Parameters:
interval- the reconnect interval in ms- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
addCrlPath
Description copied from class:TCPSSLOptionsAdd a CRL path- Overrides:
addCrlPathin classTCPSSLOptions- Parameters:
crlPath- the path- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
addCrlValue
Description copied from class:TCPSSLOptionsAdd a CRL value- Overrides:
addCrlValuein classTCPSSLOptions- Parameters:
crlValue- the value- Returns:
- a reference to this, so the API can be used fluently
- Throws:
NullPointerException
-
addEnabledCipherSuite
Description copied from class:TCPSSLOptionsAdd an enabled cipher suite, appended to the ordered suites.- Overrides:
addEnabledCipherSuitein classTCPSSLOptions- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
removeEnabledCipherSuite
Description copied from class:TCPSSLOptionsRemoves an enabled cipher suite from the ordered suites.- Overrides:
removeEnabledCipherSuitein classTCPSSLOptions- Parameters:
suite- the suite- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeout
Description copied from class:TCPSSLOptionsSet the idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received nor sent within the timeout. If you want change default time unit, useTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)- Overrides:
setIdleTimeoutin classTCPSSLOptions- Parameters:
idleTimeout- the timeout- Returns:
- a reference to this, so the API can be used fluently
-
setReadIdleTimeout
Description copied from class:TCPSSLOptionsSet the read idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is received within the timeout. If you want change default time unit, useTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)- Overrides:
setReadIdleTimeoutin classTCPSSLOptions- Parameters:
idleTimeout- the read timeout- Returns:
- a reference to this, so the API can be used fluently
-
setWriteIdleTimeout
Description copied from class:TCPSSLOptionsSet the write idle timeout, default time unit is seconds. Zero means don't timeout. This determines if a connection will timeout and be closed if no data is sent within the timeout. If you want change default time unit, useTCPSSLOptions.setIdleTimeoutUnit(TimeUnit)- Overrides:
setWriteIdleTimeoutin classTCPSSLOptions- Parameters:
idleTimeout- the write timeout- Returns:
- a reference to this, so the API can be used fluently
-
setIdleTimeoutUnit
Description copied from class:TCPSSLOptionsSet the idle timeout unit. If not specified, default is seconds.- Overrides:
setIdleTimeoutUnitin classTCPSSLOptions- Parameters:
idleTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
setKeyCertOptions
Description copied from class:TCPSSLOptionsSet the key/cert options.- Overrides:
setKeyCertOptionsin classTCPSSLOptions- Parameters:
options- the key store options- Returns:
- a reference to this, so the API can be used fluently
-
setSoLinger
Description copied from class:TCPSSLOptionsSet whether SO_linger keep alive is enabled- Overrides:
setSoLingerin classTCPSSLOptions- Parameters:
soLinger- true if SO_linger is enabled- Returns:
- a reference to this, so the API can be used fluently
-
setSsl
Description copied from class:TCPSSLOptionsSet whether SSL/TLS is enabled- Overrides:
setSslin classTCPSSLOptions- Parameters:
ssl- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setTcpKeepAlive
Description copied from class:TCPSSLOptionsSet whether TCP keep alive is enabled- Overrides:
setTcpKeepAlivein classTCPSSLOptions- Parameters:
tcpKeepAlive- true if TCP keep alive is enabled- Returns:
- a reference to this, so the API can be used fluently
-
setTcpNoDelay
Description copied from class:TCPSSLOptionsSet whether TCP no delay is enabled- Overrides:
setTcpNoDelayin classTCPSSLOptions- Parameters:
tcpNoDelay- true if TCP no delay is enabled (Nagle disabled)- Returns:
- a reference to this, so the API can be used fluently
-
setTrustOptions
Description copied from class:TCPSSLOptionsSet the trust options.- Overrides:
setTrustOptionsin classTCPSSLOptions- Parameters:
options- the trust options- Returns:
- a reference to this, so the API can be used fluently
-
setReceiveBufferSize
Description copied from class:NetworkOptionsSet the TCP receive buffer size- Overrides:
setReceiveBufferSizein classTCPSSLOptions- Parameters:
receiveBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setReuseAddress
Description copied from class:NetworkOptionsSet the value of reuse address- Overrides:
setReuseAddressin classTCPSSLOptions- Parameters:
reuseAddress- the value of reuse address- Returns:
- a reference to this, so the API can be used fluently
-
setReusePort
Description copied from class:NetworkOptionsSet the value of reuse port. This is only supported by native transports.- Overrides:
setReusePortin classTCPSSLOptions- Parameters:
reusePort- the value of reuse port- Returns:
- a reference to this, so the API can be used fluently
-
setSendBufferSize
Description copied from class:NetworkOptionsSet the TCP send buffer size- Overrides:
setSendBufferSizein classTCPSSLOptions- Parameters:
sendBufferSize- the buffers size, in bytes- Returns:
- a reference to this, so the API can be used fluently
-
setTrafficClass
Description copied from class:NetworkOptionsSet the value of traffic class- Overrides:
setTrafficClassin classTCPSSLOptions- Parameters:
trafficClass- the value of traffic class- Returns:
- a reference to this, so the API can be used fluently
-
setUseAlpn
Description copied from class:TCPSSLOptionsSet the ALPN usage.- Overrides:
setUseAlpnin classTCPSSLOptions- Parameters:
useAlpn- true when Application-Layer Protocol Negotiation should be used
-
setSslEngineOptions
Description copied from class:TCPSSLOptionsSet to use SSL engine implementation to use.- Overrides:
setSslEngineOptionsin classTCPSSLOptions- Parameters:
sslEngineOptions- the ssl engine to use- Returns:
- a reference to this, so the API can be used fluently
-
setEnabledSecureTransportProtocols
public EventBusOptions setEnabledSecureTransportProtocols(Set<String> enabledSecureTransportProtocols) Description copied from class:TCPSSLOptionsSets the list of enabled SSL/TLS protocols.- Overrides:
setEnabledSecureTransportProtocolsin classTCPSSLOptions- Parameters:
enabledSecureTransportProtocols- the SSL/TLS protocols to enable- Returns:
- a reference to this, so the API can be used fluently
-
addEnabledSecureTransportProtocol
Description copied from class:TCPSSLOptionsAdd an enabled SSL/TLS protocols, appended to the ordered protocols.- Overrides:
addEnabledSecureTransportProtocolin classTCPSSLOptions- Parameters:
protocol- the SSL/TLS protocol to enable- Returns:
- a reference to this, so the API can be used fluently
-
removeEnabledSecureTransportProtocol
Description copied from class:TCPSSLOptionsRemoves an enabled SSL/TLS protocol from the ordered protocols.- Overrides:
removeEnabledSecureTransportProtocolin classTCPSSLOptions- Parameters:
protocol- the SSL/TLS protocol to disable- Returns:
- a reference to this, so the API can be used fluently
-
setTcpFastOpen
Description copied from class:TCPSSLOptionsEnable theTCP_FASTOPENoption - only with linux native transport.- Overrides:
setTcpFastOpenin classTCPSSLOptions- Parameters:
tcpFastOpen- the fast open value
-
setTcpCork
Description copied from class:TCPSSLOptionsEnable theTCP_CORKoption - only with linux native transport.- Overrides:
setTcpCorkin classTCPSSLOptions- Parameters:
tcpCork- the cork value
-
setTcpQuickAck
Description copied from class:TCPSSLOptionsEnable theTCP_QUICKACKoption - only with linux native transport.- Overrides:
setTcpQuickAckin classTCPSSLOptions- Parameters:
tcpQuickAck- the quick ack value
-
setTcpUserTimeout
Description copied from class:TCPSSLOptionsSets theTCP_USER_TIMEOUToption - only with linux native transport.- Overrides:
setTcpUserTimeoutin classTCPSSLOptions- Parameters:
tcpUserTimeout- the tcp user timeout value
-
setLogActivity
Description copied from class:NetworkOptionsSet to true to enabled network activity logging: Netty's pipeline is configured for logging on Netty's logger.- Overrides:
setLogActivityin classTCPSSLOptions- Parameters:
logEnabled- true for logging the network activity- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeout
Description copied from class:TCPSSLOptionsSet the SSL handshake timeout, default time unit is seconds.- Overrides:
setSslHandshakeTimeoutin classTCPSSLOptions- Parameters:
sslHandshakeTimeout- the SSL handshake timeout to set, in milliseconds- Returns:
- a reference to this, so the API can be used fluently
-
setSslHandshakeTimeoutUnit
Description copied from class:TCPSSLOptionsSet the SSL handshake timeout unit. If not specified, default is seconds.- Overrides:
setSslHandshakeTimeoutUnitin classTCPSSLOptions- Parameters:
sslHandshakeTimeoutUnit- specify time unit.- Returns:
- a reference to this, so the API can be used fluently
-
setTrustAll
Set whether all server certificates should be trusted.- Parameters:
trustAll- true if all should be trusted- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
isTrustAll
public boolean isTrustAll()- Returns:
- true if all server certificates should be trusted
- See Also:
-
getConnectTimeout
public int getConnectTimeout()- Returns:
- the value of connect timeout
- See Also:
-
setConnectTimeout
Sets the connect timeout- Parameters:
connectTimeout- connect timeout, in ms- Returns:
- a reference to this, so the API can be used fluently
- See Also:
-
getClusterPingInterval
public long getClusterPingInterval()Get the value of cluster ping reply interval, in ms. After sending a ping, if a pong is not received in this time, the node will be considered dead.- Returns:
- the value of cluster ping reply interval
-
setClusterPingInterval
Set the value of cluster ping interval, in ms.- Parameters:
clusterPingInterval- The value of cluster ping interval, in ms.- Returns:
- a reference to this, so the API can be used fluently
-
getClusterPingReplyInterval
public long getClusterPingReplyInterval()Get the value of cluster ping reply interval, in ms. After sending a ping, if a pong is not received in this time, the node will be considered dead.- Returns:
- the value of cluster ping reply interval
-
setClusterPingReplyInterval
Set the value of cluster ping reply interval, in ms.- Parameters:
clusterPingReplyInterval- The value of cluster ping reply interval, in ms.- Returns:
- a reference to this, so the API can be used fluently
-
getClusterPublicHost
Get the public facing host to be used when clustering.- Returns:
- the public facing port
-
setClusterPublicHost
Set the public facing hostname to be used for clustering. Sometimes, e.g. when running on certain clouds, the local address the server listens on for clustering is not the same address that other nodes connect to it at, as the OS / cloud infrastructure does some kind of proxying. If this is the case you can specify a public hostname which is different from the hostname the server listens at.The default value is null which means use the same as the cluster hostname.
- Parameters:
clusterPublicHost- the public host name to use- Returns:
- a reference to this, so the API can be used fluently
-
getClusterPublicPort
public int getClusterPublicPort()Gets the public facing port to be used when clustering.- Returns:
- the public facing port
-
setClusterPublicPort
SeesetClusterPublicHost(String)for an explanation.- Parameters:
clusterPublicPort- the public port to use- Returns:
- a reference to this, so the API can be used fluently
-
getClusterNodeMetadata
User-supplied information about this node when Vert.x is clustered.The data may be to select a node for a given message. For example, it could be used to implement a partioning strategy.
Not used by default.
- Returns:
- user-supplied information about this node when Vert.x is clustered
-
setClusterNodeMetadata
Set information about this node when Vert.x is clustered.The data may be used to select a node for a given message. For example, it could be used to implement a partioning strategy.
Not used by default.
- Parameters:
clusterNodeMetadata- user-supplied information about this node when Vert.x is clustered- Returns:
- a reference to this, so the API can be used fluently
-