Class RabbitMQOptions
java.lang.Object
io.vertx.core.net.NetworkOptions
io.vertx.core.net.TCPSSLOptions
io.vertx.core.net.ClientOptionsBase
io.vertx.core.net.NetClientOptions
io.vertx.rabbitmq.RabbitMQOptions
RabbitMQ client options, most
- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default automatic recovery enabled =falsestatic final booleanThe default automatic recovery on initial connection =truestatic final StringThe default connection name =VertxRabbitMQstatic final intThe default connection timeout =60000static final intThe default handshake timeout =10000static final StringThe default host =localhoststatic final longThe default network recovery internal =5000static final StringThe default password =gueststatic final intThe default port =- 1-5671for SSL otherwise5672static final longThe default connection retry delay =10000static final intThe default requested channel max =0static final intThe default connection timeout =60static final booleanThe default use nio sockets =falsestatic final StringThe default user =gueststatic final StringThe default virtual host =/Fields inherited from class NetClientOptions
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_REGISTER_WRITE_HANDLERFields inherited from class ClientOptionsBase
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAMEFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.rabbitmq.client.Address> intcom.rabbitmq.client.impl.CredentialsProvidercom.rabbitmq.client.impl.CredentialsRefreshServiceintgetHost()booleancom.rabbitmq.client.MetricsCollectorlongintgetPort()intintcom.rabbitmq.client.DefaultSaslConfiggetUri()getUser()booleanbooleanbooleansetAddresses(List<com.rabbitmq.client.Address> addresses) Set multiple addresses for cluster mode.setAutomaticRecoveryEnabled(boolean automaticRecoveryEnabled) Enables or disables automatic connection recovery.setAutomaticRecoveryOnInitialConnection(boolean automaticRecoveryOnInitialConnection) Enable or disable automatic recovery on initial connections.setConnectionName(String connectionName) setConnectionTimeout(int connectionTimeout) Set the TCP connection timeout, in milliseconds,zerofor infinite).setCredentialsProvider(com.rabbitmq.client.impl.CredentialsProvider credentialsProvider) Provides a RabbitMQ credentials provider for using dynamic credentials.setCredentialsRefreshService(com.rabbitmq.client.impl.CredentialsRefreshService credentialsRefreshService) Provides a RabbitMQ credentials refresh service for refreshing dynamic credentials.setHandshakeTimeout(int handshakeTimeout) Set the AMQP 0-9-1 protocol handshake timeout, in millisecondsSet the default host to use for connections.setHostnameVerificationAlgorithm(String algorithm) Set the hostname verification algorithm interval To disable hostname verification, set hostnameVerificationAlgorithm to an empty StringsetIncludeProperties(boolean includeProperties) Set wether to include properties when a broker message is passed on the event bussetKeyCertOptions(KeyCertOptions options) Set the key/cert options.setMetricsCollector(com.rabbitmq.client.MetricsCollector metricsCollector) Provides a metrics collector for RabbitMQ.setNetworkRecoveryInterval(long networkRecoveryInterval) Set how long in milliseconds will automatic recovery wait before attempting to reconnect, default is5000setPassword(String password) Set the password to use when connecting to the broker.setPort(int port) Set the default port to use for connections.setReconnectAttempts(int attempts) Set the value of reconnect attemptssetReconnectInterval(long interval) Set the reconnect intervalsetRequestedChannelMax(int requestedChannelMax) Set the initially requested maximum channel number,zerofor unlimited.setRequestedHeartbeat(int requestedHeartbeat) Set the initially requested heartbeat interval, in seconds,zerofor none.setSaslConfig(com.rabbitmq.client.DefaultSaslConfig saslConfig) Set the SASL mechanism for rabbitmq authenticationsetSsl(boolean ssl) Set whether SSL/TLS is enabledsetTrustAll(boolean trustAll) Set whether all server certificates should be trustedsetTrustOptions(TrustOptions options) Set the trust options.setUseNio(boolean useNio) Enables or disables usage of NIO Sockets.Set the AMQP user name to use when connecting to the broker.setVirtualHost(String virtualHost) Set the virtual host to use when connecting to the broker.toJson()Convert to JSONMethods inherited from class NetClientOptions
addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, addNonProxyHost, getApplicationLayerProtocols, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, isRegisterWriteHandler, removeEnabledCipherSuite, removeEnabledSecureTransportProtocol, setActivityLogDataFormat, setApplicationLayerProtocols, setConnectTimeout, setEnabledSecureTransportProtocols, setIdleTimeout, setIdleTimeoutUnit, setLocalAddress, setLogActivity, setMetricsName, setNonProxyHosts, setProxyOptions, setReadIdleTimeout, setReceiveBufferSize, setRegisterWriteHandler, setReuseAddress, setReusePort, setSendBufferSize, setSoLinger, setSslEngineOptions, setSslHandshakeTimeout, setSslHandshakeTimeoutUnit, setTcpCork, setTcpFastOpen, setTcpKeepAlive, setTcpNoDelay, setTcpQuickAck, setTcpUserTimeout, setTrafficClass, setUseAlpn, setWriteIdleTimeoutMethods inherited from class ClientOptionsBase
createSSLOptions, getConnectTimeout, getLocalAddress, getMetricsName, getNonProxyHosts, getOrCreateSSLOptions, getProxyOptions, getSslOptions, isTrustAllMethods inherited from class TCPSSLOptions
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getIdleTimeoutUnit, getKeyCertOptions, getReadIdleTimeout, getReceiveBufferSize, getSendBufferSize, getSoLinger, getSslEngineOptions, getSslHandshakeTimeout, getSslHandshakeTimeoutUnit, 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
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port =- 1-5671for SSL otherwise5672- See Also:
-
DEFAULT_HOST
-
DEFAULT_USER
-
DEFAULT_PASSWORD
-
DEFAULT_VIRTUAL_HOST
-
DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_CONNECTION_TIMEOUTThe default connection timeout =60000- See Also:
-
DEFAULT_REQUESTED_HEARTBEAT
public static final int DEFAULT_REQUESTED_HEARTBEATThe default connection timeout =60- See Also:
-
DEFAULT_HANDSHAKE_TIMEOUT
public static final int DEFAULT_HANDSHAKE_TIMEOUTThe default handshake timeout =10000- See Also:
-
DEFAULT_REQUESTED_CHANNEL_MAX
public static final int DEFAULT_REQUESTED_CHANNEL_MAXThe default requested channel max =0- See Also:
-
DEFAULT_NETWORK_RECOVERY_INTERNAL
public static final long DEFAULT_NETWORK_RECOVERY_INTERNALThe default network recovery internal =5000- See Also:
-
DEFAULT_AUTOMATIC_RECOVERY_ENABLED
public static final boolean DEFAULT_AUTOMATIC_RECOVERY_ENABLEDThe default automatic recovery enabled =false- See Also:
-
DEFAULT_AUTOMATIC_RECOVERY_ON_INITIAL_CONNECTION
public static final boolean DEFAULT_AUTOMATIC_RECOVERY_ON_INITIAL_CONNECTIONThe default automatic recovery on initial connection =true- See Also:
-
DEFAULT_RECONNECT_INTERVAL
public static final long DEFAULT_RECONNECT_INTERVALThe default connection retry delay =10000- See Also:
-
DEFAULT_USE_NIO_SOCKETS
public static final boolean DEFAULT_USE_NIO_SOCKETSThe default use nio sockets =false- See Also:
-
DEFAULT_CONNECTION_NAME
The default connection name =VertxRabbitMQ- See Also:
-
-
Constructor Details
-
RabbitMQOptions
public RabbitMQOptions() -
RabbitMQOptions
-
RabbitMQOptions
-
-
Method Details
-
toJson
Description copied from class:ClientOptionsBaseConvert to JSON- Overrides:
toJsonin classNetClientOptions- Returns:
- the JSON
-
getAddresses
-
setAddresses
Set multiple addresses for cluster mode.- Parameters:
addresses- addresses of AMQP cluster- Returns:
- a reference to this, so the API can be used fluently
-
getUri
-
setUri
-
getUser
- Returns:
- the AMQP user name to use when connecting to the broker
-
setUser
Set the AMQP user name to use when connecting to the broker.- Parameters:
user- the user name- Returns:
- a reference to this, so the API can be used fluently
-
getPassword
- Returns:
- the password to use when connecting to the broker
-
setPassword
Set the password to use when connecting to the broker.- Parameters:
password- the password- Returns:
- a reference to this, so the API can be used fluently
-
getHost
- Returns:
- the default host to use for connections
-
setHost
Set the default host to use for connections.- Parameters:
host- the default host- Returns:
- a reference to this, so the API can be used fluently
-
getVirtualHost
- Returns:
- the virtual host to use when connecting to the broker
-
setVirtualHost
Set the virtual host to use when connecting to the broker.- Parameters:
virtualHost- the virtual host- Returns:
- a reference to this, so the API can be used fluently
-
getPort
public int getPort()- Returns:
- the default port to use for connections
-
setPort
Set the default port to use for connections.- Parameters:
port- the default port- Returns:
- a reference to this, so the API can be used fluently
-
getConnectionTimeout
public int getConnectionTimeout()- Returns:
- the TCP connection timeout
-
setConnectionTimeout
Set the TCP connection timeout, in milliseconds,zerofor infinite).- Parameters:
connectionTimeout- the timeouut in milliseconds.- Returns:
- a reference to this, so the API can be used fluently
-
getRequestedHeartbeat
public int getRequestedHeartbeat()- Returns:
- the initially requested heartbeat interval
-
setRequestedHeartbeat
Set the initially requested heartbeat interval, in seconds,zerofor none.- Parameters:
requestedHeartbeat- the request heartbeat interval- Returns:
- a reference to this, so the API can be used fluently
-
getHandshakeTimeout
public int getHandshakeTimeout()- Returns:
- the AMQP 0-9-1 protocol handshake timeout
-
setHandshakeTimeout
Set the AMQP 0-9-1 protocol handshake timeout, in milliseconds- Parameters:
handshakeTimeout- the timeout in milliseconds- Returns:
- a reference to this, so the API can be used fluently
-
getRequestedChannelMax
public int getRequestedChannelMax()- Returns:
- the initially requested maximum channel number
-
setRequestedChannelMax
Set the initially requested maximum channel number,zerofor unlimited.- Parameters:
requestedChannelMax- the requested maximum channel number- Returns:
- a reference to this, so the API can be used fluently
-
getNetworkRecoveryInterval
public long getNetworkRecoveryInterval()- Returns:
- automatic connection recovery interval
-
setNetworkRecoveryInterval
Set how long in milliseconds will automatic recovery wait before attempting to reconnect, default is5000- Parameters:
networkRecoveryInterval- the connection recovery interval- Returns:
- a reference to this, so the API can be used fluently
-
isAutomaticRecoveryEnabled
public boolean isAutomaticRecoveryEnabled()- Returns:
trueif automatic connection recovery is enabled,falseotherwise
-
setAutomaticRecoveryEnabled
Enables or disables automatic connection recovery.- Parameters:
automaticRecoveryEnabled- iftrue, enables connection recovery- Returns:
- a reference to this, so the API can be used fluently
-
isAutomaticRecoveryOnInitialConnection
public boolean isAutomaticRecoveryOnInitialConnection() -
setAutomaticRecoveryOnInitialConnection
public RabbitMQOptions setAutomaticRecoveryOnInitialConnection(boolean automaticRecoveryOnInitialConnection) Enable or disable automatic recovery on initial connections. If automatic recovery is enabled it will, by default, make multiple attempts to connect on startup. This can cause problems with the configuration is wrong, and it is this bad configuration that is preventing connection. To work around this automaticRecoveryOnInitialConnection can be set to false (it default to true). When automaticRecoveryOnInitialConnection is false (and automaticRecoveryEnabled is true) reconnection attempts will not be made until after the first connection has been successful.- Parameters:
automaticRecoveryOnInitialConnection- iffalse, prevents automatic recovery on the first connection attempts.- Returns:
- a reference to this, so the API can be used fluently
-
getIncludeProperties
public boolean getIncludeProperties()- Returns:
- wether to include properties when a broker message is passed on the event bus
-
setIncludeProperties
Set wether to include properties when a broker message is passed on the event bus- Parameters:
includeProperties- wether to include properties- Returns:
- a reference to this, so the API can be used fluently
-
isNioEnabled
public boolean isNioEnabled()- Returns:
trueif NIO Sockets are enabled,falseotherwise
-
setUseNio
Enables or disables usage of NIO Sockets.- Parameters:
useNio- iftrue, enables NIO Sockets- Returns:
- a reference to this, so the API can be used fluently
-
getCredentialsProvider
public com.rabbitmq.client.impl.CredentialsProvider getCredentialsProvider()- Returns:
- A RabbitMQ credentials provider for using dynamic credentials.
-
setCredentialsProvider
public RabbitMQOptions setCredentialsProvider(com.rabbitmq.client.impl.CredentialsProvider credentialsProvider) Provides a RabbitMQ credentials provider for using dynamic credentials.- Returns:
- a reference to this, so the API can be used fluently.
-
getCredentialsRefreshService
public com.rabbitmq.client.impl.CredentialsRefreshService getCredentialsRefreshService()- Returns:
- A RabbitMQ credentials refresh service for refreshing dynamic credentials.
-
setCredentialsRefreshService
public RabbitMQOptions setCredentialsRefreshService(com.rabbitmq.client.impl.CredentialsRefreshService credentialsRefreshService) Provides a RabbitMQ credentials refresh service for refreshing dynamic credentials.- Returns:
- a reference to this, so the API can be used fluently.
-
getSaslConfig
public com.rabbitmq.client.DefaultSaslConfig getSaslConfig()- Returns:
- The specified DefaultSaslConfiguration rabbitmq authentication mechanism
-
setSaslConfig
Set the SASL mechanism for rabbitmq authentication- Parameters:
saslConfig- The- Returns:
- a reference to this, so the API can be used fluently.
-
getMetricsCollector
public com.rabbitmq.client.MetricsCollector getMetricsCollector() -
setMetricsCollector
Provides a metrics collector for RabbitMQ.- Returns:
- a reference to this, so the API can be used fluently.
- See Also:
-
setReconnectAttempts
Description copied from class:NetClientOptionsSet the value of reconnect attempts- Overrides:
setReconnectAttemptsin classNetClientOptions- Parameters:
attempts- the maximum number of reconnect attempts- Returns:
- a reference to this, so the API can be used fluently
-
setReconnectInterval
Description copied from class:NetClientOptionsSet the reconnect interval- Overrides:
setReconnectIntervalin classNetClientOptions- Parameters:
interval- the reconnect interval in ms- 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 classNetClientOptions- Parameters:
ssl- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setTrustAll
Description copied from class:ClientOptionsBaseSet whether all server certificates should be trusted- Overrides:
setTrustAllin classNetClientOptions- Parameters:
trustAll- true if all should be trusted- Returns:
- a reference to this, so the API can be used fluently
-
setKeyCertOptions
Description copied from class:TCPSSLOptionsSet the key/cert options.- Overrides:
setKeyCertOptionsin classNetClientOptions- Parameters:
options- the key store options- Returns:
- a reference to this, so the API can be used fluently
-
setTrustOptions
Description copied from class:TCPSSLOptionsSet the trust options.- Overrides:
setTrustOptionsin classNetClientOptions- Parameters:
options- the trust options- Returns:
- a reference to this, so the API can be used fluently
-
setHostnameVerificationAlgorithm
Description copied from class:NetClientOptionsSet the hostname verification algorithm interval To disable hostname verification, set hostnameVerificationAlgorithm to an empty String- Overrides:
setHostnameVerificationAlgorithmin classNetClientOptions- Parameters:
algorithm- should be HTTPS, LDAPS or an empty String- Returns:
- a reference to this, so the API can be used fluently
-
getConnectionName
-
setConnectionName
-