public class Options
extends java.lang.Object
Builder.
This class and the builder associated with it, is basically a long list of parameters. The documentation attempts
to clarify the value of each parameter in place on the builder and here, but it may be easier to read the documentation
starting with the Builder, since it has a simple list of methods that configure the connection.| Modifier and Type | Class and Description |
|---|---|
static class |
Options.Builder
Options are created using a Builder.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
Default size for buffers in the connection, not as available as other settings,
this is primarily changed for testing,
getBufferSize(). |
static java.time.Duration |
DEFAULT_CONNECTION_TIMEOUT
Default connection timeout, see
getConnectionTimeout(). |
static java.lang.String |
DEFAULT_DATA_PORT_TYPE
Default dataport class, which will use a TCP socket,
getDataPortType(). |
static boolean |
DEFAULT_DISCARD_MESSAGES_WHEN_OUTGOING_QUEUE_FULL
This value is used internally to discard messages when the outgoing queue is full.
|
static java.lang.String |
DEFAULT_INBOX_PREFIX
Default prefix used for inboxes, you can change this to manage authorization of subjects.
|
static int |
DEFAULT_MAX_CONTROL_LINE
The default length, 4096 bytes, the client will allow in an
outgoing protocol control line,
getMaxControlLine(). |
static int |
DEFAULT_MAX_MESSAGES_IN_OUTGOING_QUEUE
This value is used internally to limit the number of messages allowed in the outgoing queue.
|
static int |
DEFAULT_MAX_PINGS_OUT
Default maximum number of pings have not received a response allowed by the
client,
getMaxPingsOut(). |
static int |
DEFAULT_MAX_RECONNECT
Default maximum number of reconnect attempts, see
getMaxReconnect(). |
static java.time.Duration |
DEFAULT_PING_INTERVAL
Default server ping interval.
|
static int |
DEFAULT_PORT
Default server port.
|
static int |
DEFAULT_RECONNECT_BUF_SIZE
Default of pending message buffer that is used for buffering messages that
are published during a disconnect/reconnect,
getReconnectBufferSize(). |
static java.time.Duration |
DEFAULT_RECONNECT_JITTER
Default wait time before attempting reconnection to the same server, see
getReconnectJitter(). |
static java.time.Duration |
DEFAULT_RECONNECT_JITTER_TLS
Default wait time before attempting reconnection to the same server, see
getReconnectJitterTls(). |
static java.time.Duration |
DEFAULT_RECONNECT_WAIT
Default wait time before attempting reconnection to the same server, see
getReconnectWait(). |
static java.time.Duration |
DEFAULT_REQUEST_CLEANUP_INTERVAL
Default interval to clean up cancelled/timed out requests.
|
static java.util.function.Supplier<java.util.concurrent.ExecutorService> |
DEFAULT_SINGLE_THREAD_EXECUTOR
Default supplier for creating a single-threaded executor service.
|
static java.time.Duration |
DEFAULT_SOCKET_WRITE_TIMEOUT
Default socket write timeout, see
getSocketWriteTimeout(). |
static java.lang.String |
DEFAULT_SSL_PROTOCOL
Default SSL protocol used to create an SSLContext if the
secure property is used. |
static java.lang.String |
DEFAULT_THREAD_NAME_PREFIX
Default thread name prefix.
|
static java.lang.String |
DEFAULT_URL
Default server URL.
|
static int |
MAX_MESSAGES_IN_NETWORK_BUFFER
This value is used internally to limit the number of messages sent in a single network I/O.
|
static long |
MINIMUM_SOCKET_READ_TIMEOUT_GT_CONNECTION_TIMEOUT
Deprecated.
No longer enforcing a minimum
|
static long |
MINIMUM_SOCKET_WRITE_TIMEOUT_GT_CONNECTION_TIMEOUT
Deprecated.
No longer enforcing a minimum compared to the connection timeout
|
static long |
MINIMUM_SOCKET_WRITE_TIMEOUT_NANOS
This is set to 100 nanos to ensure that the scheduled task can execute
|
static java.lang.String |
PROP_CALLBACK_THREAD_FACTORY_CLASS
Property used to set class name for the Callback Thread Factory
callbackThreadFactory. |
static java.lang.String |
PROP_CLEANUP_INTERVAL
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_CLIENT_SIDE_LIMIT_CHECKS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_CONNECT_THREAD_FACTORY_CLASS
Property used to set class name for the Connect Thread Factory
connectThreadFactory. |
static java.lang.String |
PROP_CONNECTION_CB
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_CONNECTION_NAME
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_CONNECTION_TIMEOUT
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_CREDENTIAL_PATH
Property used to set the path to a credentials file to be used in a FileAuthHandler
|
static java.lang.String |
PROP_DATA_PORT_TYPE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_DISCARD_MESSAGES_WHEN_OUTGOING_QUEUE_FULL
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_DISPATCHER_FACTORY_CLASS
Property used to set class name for the Dispatcher Factory
dispatcherFactory. |
static java.lang.String |
PROP_ERROR_LISTENER
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_EXECUTOR_SERVICE_CLASS
Property used to set class name for the Executor Service (executor) class
executor. |
static java.lang.String |
PROP_FAST_FALLBACK
Property used to enable fast fallback algorithm for socket connection.
|
static java.lang.String |
PROP_FORCE_FLUSH_ON_REQUEST
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_IGNORE_DISCOVERED_SERVERS
Property used to set whether to ignore discovered servers when connecting
|
static java.lang.String |
PROP_IGNORE_DISCOVERED_SERVERS_PREFERRED
Preferred property used to set whether to ignore discovered servers when connecting
|
static java.lang.String |
PROP_INBOX_PREFIX
Property used to set the inbox prefix
|
static java.lang.String |
PROP_KEYSTORE
Property for the keystore path used to create an SSLContext
|
static java.lang.String |
PROP_KEYSTORE_PASSWORD
Property for the keystore password used to create an SSLContext
|
static java.lang.String |
PROP_MAX_CONTROL_LINE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_MAX_MESSAGES_IN_OUTGOING_QUEUE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_MAX_PINGS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_MAX_RECONNECT
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_NO_ECHO
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_NO_HEADERS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_NO_NORESPONDERS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_NO_RESOLVE_HOSTNAMES
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_NORANDOMIZE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_OPENTLS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_PASSWORD
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_PEDANTIC
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_PING_INTERVAL
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_READ_LISTENER_CLASS
Property used to set class name for the ReaderListener implementation
readListener. |
static java.lang.String |
PROP_RECONNECT_BUF_SIZE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_RECONNECT_JITTER
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_RECONNECT_JITTER_TLS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_RECONNECT_WAIT
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_REPORT_NO_RESPONDERS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SCHEDULED_EXECUTOR_SERVICE_CLASS
Property used to set class name for the Executor Service (executor) class
executor. |
static java.lang.String |
PROP_SECURE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SERVERS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SERVERS_POOL_IMPLEMENTATION_CLASS
Property used to set class name for ServerPool implementation
serverPool. |
static java.lang.String |
PROP_SERVERS_POOL_IMPLEMENTATION_CLASS_PREFERRED
Preferred property used to set class name for ServerPool implementation
serverPool. |
static java.lang.String |
PROP_SOCKET_READ_TIMEOUT_MS
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SOCKET_RECEIVE_BUFFER_SIZE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SOCKET_SEND_BUFFER_SIZE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SOCKET_SO_LINGER
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SOCKET_WRITE_TIMEOUT
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_SSL_CONTEXT_FACTORY_CLASS
Property used to set class name for the SSLContextFactory
sslContextFactory. |
static java.lang.String |
PROP_STATISTICS_COLLECTOR
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_TIME_TRACE_LOGGER
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_TLS_ALGORITHM
Property for the algorithm used to create an SSLContext
|
static java.lang.String |
PROP_TLS_FIRST
Property used to configure tls first behavior
This property is a boolean flag, telling connections whether
to do TLS upgrade first, before INFO
|
static java.lang.String |
PROP_TOKEN
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_TOKEN_SUPPLIER
Property used to configure the token supplier from a Properties object.
|
static java.lang.String |
PROP_TRUSTSTORE
Property for the truststore path used to create an SSLContext
|
static java.lang.String |
PROP_TRUSTSTORE_PASSWORD
Property for the truststore password used to create an SSLContext
|
static java.lang.String |
PROP_URL
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_USE_DISPATCHER_WITH_EXECUTOR
Property used to a dispatcher that dispatches messages via the executor service instead of with a blocking call.
|
static java.lang.String |
PROP_USE_OLD_REQUEST_STYLE
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_USE_TIMEOUT_EXCEPTION
Property used to throw
TimeoutException on timeout instead of CancellationException. |
static java.lang.String |
PROP_USERNAME
Property used to configure a builder from a Properties object.
|
static java.lang.String |
PROP_UTF8_SUBJECTS
This property is used to enable support for UTF8 subjects.
|
static java.lang.String |
PROP_VERBOSE
Property used to configure a builder from a Properties object.
|
| Modifier and Type | Method and Description |
|---|---|
io.nats.client.impl.DataPort |
buildDataPort()
the data port described by these options
|
static Options.Builder |
builder()
Creates a builder for the options in a fluent style
|
java.nio.CharBuffer |
buildProtocolConnectOptionsString(java.lang.String serverURI,
boolean includeAuth,
byte[] nonce)
Create the options string sent with the connect message.
|
boolean |
clientSideLimitChecks()
clientSideLimitChecks
|
java.net.URI |
createURIForServer(java.lang.String serverURI)
create a URI from a server uri.
|
boolean |
executorIsInternal()
whether the general executor is the internal one versus a user supplied one
|
boolean |
forceFlushOnRequest()
Whether to flush on any user request
|
AuthHandler |
getAuthHandler()
the auth handler, or null, see
authHandler() in the builder doc |
int |
getBufferSize()
the default size for buffers in the connection code, see
bufferSize() in the builder doc |
java.util.concurrent.ExecutorService |
getCallbackExecutor()
the callback executor, see
callbackThreadFactory() in the builder doc |
java.util.concurrent.ExecutorService |
getConnectExecutor()
the connect executor, see
connectThreadFactory() in the builder doc |
ConnectionListener |
getConnectionListener()
the connection listener, or null, see
connectionListener() in the builder doc |
java.lang.String |
getConnectionName()
the connectionName, see
connectionName() in the builder doc |
java.time.Duration |
getConnectionTimeout()
the connectionTimeout, see
connectionTimeout() in the builder doc |
java.lang.String |
getDataPortType()
the DataPort class type for connections created by this options object, see
dataPortType() in the builder doc |
io.nats.client.impl.DispatcherFactory |
getDispatcherFactory()
Get the DispatcherFactory implementation.
|
ErrorListener |
getErrorListener()
the error listener.
|
java.util.concurrent.ExecutorService |
getExecutor()
Get the general executor
|
java.util.List<java.util.function.Consumer<io.nats.client.support.HttpRequest>> |
getHttpRequestInterceptors()
the list of HttpRequest interceptors.
|
java.lang.String |
getInboxPrefix()
the inbox prefix to use for requests, see
inboxPrefix() in the builder doc |
int |
getMaxControlLine()
the maximum length of a control line, see
maxControlLine() in the builder doc |
int |
getMaxMessagesInOutgoingQueue()
the maximum number of messages in the outgoing queue, see
maxMessagesInOutgoingQueue(int) in the builder doc |
int |
getMaxPingsOut()
the maxPingsOut to limit the number of pings on the wire, see
maxPingsOut() in the builder doc |
int |
getMaxReconnect()
the maxReconnect attempts to make before failing, see
maxReconnects() in the builder doc |
java.util.List<io.nats.client.support.NatsUri> |
getNatsServerUris()
the servers as configured in options as NatsUri's, see
servers() in the builder doc |
java.lang.String |
getPassword()
Deprecated.
converts the char array to a string, use getPasswordChars instead for more security
|
char[] |
getPasswordChars()
the password to use for basic authentication, see
userInfo() in the builder doc |
java.time.Duration |
getPingInterval()
the pingInterval, see
pingInterval() in the builder doc |
java.net.Proxy |
getProxy()
the proxy to used for all sockets.
|
ReadListener |
getReadListener()
the read listener, or null, see
readListener() in the builder doc |
int |
getReceiveBufferSize()
the number of bytes to set the for the SO_RCVBUF property on the socket
|
long |
getReconnectBufferSize()
the reconnectBufferSize, to limit the amount of data held during
reconnection attempts, see
reconnectBufferSize() in the builder doc |
ReconnectDelayHandler |
getReconnectDelayHandler()
the reconnection delay handler, or null, see
reconnectDelayHandler() in the builder doc |
java.time.Duration |
getReconnectJitter()
the reconnectJitter, used between reconnect attempts to vary the reconnect wait, see
reconnectJitter() in the builder doc |
java.time.Duration |
getReconnectJitterTls()
the reconnectJitterTls, used between reconnect attempts to vary the reconnect wait whe using tls/secure, see
reconnectJitterTls() in the builder doc |
java.time.Duration |
getReconnectWait()
the reconnectWait, used between reconnect attempts, see
reconnectWait() in the builder doc |
java.time.Duration |
getRequestCleanupInterval()
the request cleanup interval, see
requestCleanupInterval() in the builder doc |
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutor()
Get the ScheduledExecutorService instance
|
int |
getSendBufferSize()
the number of bytes to set the for the SO_SNDBUF property on the socket
|
ServerPool |
getServerPool()
Get the ServerPool implementation.
|
java.util.List<java.net.URI> |
getServers()
the servers as configured in options as URI's, see
servers() in the builder doc |
int |
getSocketReadTimeoutMillis()
the socketReadTimeoutMillis, see
socketReadTimeoutMillis in the builder doc |
int |
getSocketSoLinger()
the socket so linger number of seconds, see
socketSoLinger() in the builder doc |
java.time.Duration |
getSocketWriteTimeout()
the socketWriteTimeout, see
socketWriteTimeout in the builder doc |
javax.net.ssl.SSLContext |
getSslContext()
the sslContext, see
secure() in the builder doc |
StatisticsCollector |
getStatisticsCollector()
the statistics collector, or null, see
statisticsCollector() in the builder doc |
TimeTraceLogger |
getTimeTraceLogger()
If the user provided a TimeTraceLogger, it's returned here.
|
java.lang.String |
getToken()
Deprecated.
converts the char array to a string, use getTokenChars instead for more security
|
char[] |
getTokenChars()
the token to be used for token-based authentication, see
token() in the builder doc
generated from the token supplier if the user supplied one. |
java.util.List<java.lang.String> |
getUnprocessedServers()
the servers as given to the options, since the servers are normalized
|
java.lang.String |
getUsername()
Deprecated.
converts the char array to a string, use getUserNameChars instead for more security
|
char[] |
getUsernameChars()
the username to use for basic authentication, see
userInfo() in the builder doc |
boolean |
isDiscardMessagesWhenOutgoingQueueFull()
should we discard messages when the outgoing queue is full, see
discardMessagesWhenOutgoingQueueFull() in the builder doc |
boolean |
isEnableFastFallback()
Whether Fast fallback algorithm is enabled for socket connect
|
boolean |
isIgnoreDiscoveredServers()
Get whether to ignore discovered servers
|
boolean |
isNoEcho()
is echo-ing disabled, see
noEcho() in the builder doc |
boolean |
isNoHeaders()
are headers disabled, see
noHeaders() in the builder doc |
boolean |
isNoNoResponders()
is NoResponders ignored disabled, see
noNoResponders() in the builder doc |
boolean |
isNoRandomize()
should we turn off randomization for server connection attempts, see
noRandomize() in the builder doc |
boolean |
isNoResolveHostnames()
should we resolve hostnames for server connection attempts, see
noResolveHostnames() in the builder doc |
boolean |
isOldRequestStyle()
the flag to turn on old style requests, see
oldStyleRequest() in the builder doc |
boolean |
isPedantic()
are we using pedantic protocol, see
pedantic() in the builder doc |
boolean |
isReportNoResponders()
should complete with exception futures for requests that get no responders instead of cancelling the future, see
reportNoResponders() in the builder doc |
boolean |
isTlsFirst()
Get whether to do tls first
|
boolean |
isTLSRequired()
is there an sslContext for these Options, otherwise false, see
secure() in the builder doc |
boolean |
isTraceConnection()
If isTraceConnection is true, the user provided a TimeTraceLogger or manually called traceConnection in the builder
|
boolean |
isTrackAdvancedStats()
should we track advanced stats, see
turnOnAdvancedStats() in the builder doc |
boolean |
isVerbose()
are we in verbose mode, see
verbose() in the builder doc |
boolean |
scheduledExecutorIsInternal()
whether the scheduled executor is the internal one versus a user supplied one
|
void |
setOldRequestStyle(boolean value)
Deprecated.
Use Builder
|
boolean |
supportUTF8Subjects()
whether utf8 subjects are supported, see
supportUTF8Subjects() in the builder doc. |
boolean |
useDispatcherWithExecutor()
Whether the dispatcher should use an executor to async messages to handlers
|
boolean |
useTimeoutException()
Get whether to throw
TimeoutException on timeout instead of CancellationException. |
public static final java.lang.String DEFAULT_URL
public static final int DEFAULT_PORT
public static final int DEFAULT_MAX_RECONNECT
getMaxReconnect().
This property is defined as 60public static final java.time.Duration DEFAULT_RECONNECT_WAIT
getReconnectWait().
This property is defined as 2000 milliseconds (2 seconds).public static final java.time.Duration DEFAULT_RECONNECT_JITTER
getReconnectJitter().
This property is defined as 100 milliseconds.public static final java.time.Duration DEFAULT_RECONNECT_JITTER_TLS
getReconnectJitterTls().
This property is defined as 1000 milliseconds (1 second).public static final java.time.Duration DEFAULT_CONNECTION_TIMEOUT
getConnectionTimeout().
This property is defined as 2 seconds.public static final java.time.Duration DEFAULT_SOCKET_WRITE_TIMEOUT
getSocketWriteTimeout().
This property is defined as 1 minute@Deprecated public static final long MINIMUM_SOCKET_WRITE_TIMEOUT_GT_CONNECTION_TIMEOUT
public static final long MINIMUM_SOCKET_WRITE_TIMEOUT_NANOS
@Deprecated public static final long MINIMUM_SOCKET_READ_TIMEOUT_GT_CONNECTION_TIMEOUT
public static final java.time.Duration DEFAULT_PING_INTERVAL
getPingInterval().
A value of <=0 means disabled.
This property is defined as 2 minutes.
public static final java.time.Duration DEFAULT_REQUEST_CLEANUP_INTERVAL
getRequestCleanupInterval().
This property is defined as 5 seconds.
public static final int DEFAULT_MAX_PINGS_OUT
getMaxPingsOut().
This property is defined as 2
public static final java.lang.String DEFAULT_SSL_PROTOCOL
secure property is used.
This property is defined as "TLSv1.2"
public static final int DEFAULT_RECONNECT_BUF_SIZE
getReconnectBufferSize().
This property is defined as 8388608 bytes, 8 * 1024 * 1024.
public static final int DEFAULT_MAX_CONTROL_LINE
getMaxControlLine().
This value is configurable on the server, and should be set here to match.
public static final java.lang.String DEFAULT_DATA_PORT_TYPE
getDataPortType().
This option is currently provided only for testing, and experimentation, the default should be used in almost all cases.
public static final int DEFAULT_BUFFER_SIZE
getBufferSize().public static final java.lang.String DEFAULT_THREAD_NAME_PREFIX
public static final java.lang.String DEFAULT_INBOX_PREFIX
getInboxPrefix(), the . is required but will be added if missing.public static final int MAX_MESSAGES_IN_NETWORK_BUFFER
getBufferSize() is used first, but if the buffer
size is large and the message sizes are small, this limit comes into play.
The choice of 1000 is arbitrary and based on testing across several operating systems. Use buffer
size for tuning.public static final int DEFAULT_MAX_MESSAGES_IN_OUTGOING_QUEUE
public static final boolean DEFAULT_DISCARD_MESSAGES_WHEN_OUTGOING_QUEUE_FULL
DEFAULT_MAX_MESSAGES_IN_OUTGOING_QUEUEpublic static final java.util.function.Supplier<java.util.concurrent.ExecutorService> DEFAULT_SINGLE_THREAD_EXECUTOR
public static final java.lang.String PROP_CONNECTION_CB
connectionListener.public static final java.lang.String PROP_DATA_PORT_TYPE
dataPortType.public static final java.lang.String PROP_ERROR_LISTENER
errorListener.public static final java.lang.String PROP_TIME_TRACE_LOGGER
timeTraceLogger.public static final java.lang.String PROP_STATISTICS_COLLECTOR
statisticsCollector.public static final java.lang.String PROP_MAX_PINGS
maxPingsOut.public static final java.lang.String PROP_PING_INTERVAL
pingInterval.public static final java.lang.String PROP_CLEANUP_INTERVAL
requestCleanupInterval.public static final java.lang.String PROP_CONNECTION_TIMEOUT
connectionTimeout.public static final java.lang.String PROP_SOCKET_READ_TIMEOUT_MS
socketReadTimeoutMillis.public static final java.lang.String PROP_SOCKET_WRITE_TIMEOUT
socketWriteTimeout.public static final java.lang.String PROP_SOCKET_SO_LINGER
socketSoLinger.public static final java.lang.String PROP_SOCKET_RECEIVE_BUFFER_SIZE
receiveBufferSize.
OVERRIDES THE UNDERLYING JAVA SOCKET IMPLEMENTATION - USE AT YOUR OWN RISKpublic static final java.lang.String PROP_SOCKET_SEND_BUFFER_SIZE
sendBufferSize.
OVERRIDES THE UNDERLYING JAVA SOCKET IMPLEMENTATION - USE AT YOUR OWN RISKpublic static final java.lang.String PROP_RECONNECT_BUF_SIZE
reconnectBufferSize.public static final java.lang.String PROP_RECONNECT_WAIT
reconnectWait.public static final java.lang.String PROP_MAX_RECONNECT
maxReconnects.public static final java.lang.String PROP_RECONNECT_JITTER
reconnectJitter.public static final java.lang.String PROP_RECONNECT_JITTER_TLS
reconnectJitterTls.public static final java.lang.String PROP_PEDANTIC
pedantic.public static final java.lang.String PROP_VERBOSE
verbose.public static final java.lang.String PROP_NO_ECHO
noEcho.public static final java.lang.String PROP_NO_HEADERS
noHeaders.public static final java.lang.String PROP_CONNECTION_NAME
connectionName.public static final java.lang.String PROP_NO_NORESPONDERS
noNoResponders.public static final java.lang.String PROP_NORANDOMIZE
noRandomize.public static final java.lang.String PROP_NO_RESOLVE_HOSTNAMES
noResolveHostnames.public static final java.lang.String PROP_REPORT_NO_RESPONDERS
reportNoResponders.public static final java.lang.String PROP_CLIENT_SIDE_LIMIT_CHECKS
clientSideLimitChecks.public static final java.lang.String PROP_SERVERS
servers. The value can be a comma-separated list of server URLs.public static final java.lang.String PROP_PASSWORD
userInfo.public static final java.lang.String PROP_USERNAME
userInfo.public static final java.lang.String PROP_TOKEN
token.public static final java.lang.String PROP_TOKEN_SUPPLIER
tokenSupplier.public static final java.lang.String PROP_URL
server.public static final java.lang.String PROP_SECURE
sslContext.
This property is a boolean flag, but it tells the options parser to use the
default SSL context. Set the default context before creating the options.public static final java.lang.String PROP_OPENTLS
sslContext.
This property is a boolean flag, but it tells the options parser to use
an SSL context that takes any server TLS certificate and does not provide
its own. The server must have tls_verify turned OFF for this option to work.public static final java.lang.String PROP_MAX_MESSAGES_IN_OUTGOING_QUEUE
maxMessagesInOutgoingQueue.public static final java.lang.String PROP_DISCARD_MESSAGES_WHEN_OUTGOING_QUEUE_FULL
discardMessagesWhenOutgoingQueueFull.public static final java.lang.String PROP_USE_OLD_REQUEST_STYLE
oldRequestStyle.public static final java.lang.String PROP_MAX_CONTROL_LINE
maxControlLine.public static final java.lang.String PROP_INBOX_PREFIX
public static final java.lang.String PROP_IGNORE_DISCOVERED_SERVERS
public static final java.lang.String PROP_IGNORE_DISCOVERED_SERVERS_PREFERRED
public static final java.lang.String PROP_SERVERS_POOL_IMPLEMENTATION_CLASS
serverPool.public static final java.lang.String PROP_SERVERS_POOL_IMPLEMENTATION_CLASS_PREFERRED
serverPool.public static final java.lang.String PROP_DISPATCHER_FACTORY_CLASS
dispatcherFactory.public static final java.lang.String PROP_SSL_CONTEXT_FACTORY_CLASS
sslContextFactory.public static final java.lang.String PROP_KEYSTORE
public static final java.lang.String PROP_KEYSTORE_PASSWORD
public static final java.lang.String PROP_TRUSTSTORE
public static final java.lang.String PROP_TRUSTSTORE_PASSWORD
public static final java.lang.String PROP_TLS_ALGORITHM
public static final java.lang.String PROP_CREDENTIAL_PATH
public static final java.lang.String PROP_TLS_FIRST
public static final java.lang.String PROP_UTF8_SUBJECTS
supportUTF8Subjects()public static final java.lang.String PROP_USE_TIMEOUT_EXCEPTION
TimeoutException on timeout instead of CancellationException.
Options.Builder.useTimeoutException().public static final java.lang.String PROP_USE_DISPATCHER_WITH_EXECUTOR
Options.Builder.useDispatcherWithExecutor().public static final java.lang.String PROP_FORCE_FLUSH_ON_REQUEST
forceFlushOnRequest.public static final java.lang.String PROP_EXECUTOR_SERVICE_CLASS
executor.public static final java.lang.String PROP_SCHEDULED_EXECUTOR_SERVICE_CLASS
executor.public static final java.lang.String PROP_CONNECT_THREAD_FACTORY_CLASS
connectThreadFactory.public static final java.lang.String PROP_CALLBACK_THREAD_FACTORY_CLASS
callbackThreadFactory.public static final java.lang.String PROP_READ_LISTENER_CLASS
readListener.public static final java.lang.String PROP_FAST_FALLBACK
enableFastFallback.@Deprecated public void setOldRequestStyle(boolean value)
value - true to use the old request stylepublic static Options.Builder builder()
public java.util.concurrent.ExecutorService getExecutor()
executor() in the builder docpublic java.util.concurrent.ScheduledExecutorService getScheduledExecutor()
scheduledExecutor() in the builder docpublic boolean executorIsInternal()
public boolean scheduledExecutorIsInternal()
public java.util.concurrent.ExecutorService getCallbackExecutor()
callbackThreadFactory() in the builder docpublic java.util.concurrent.ExecutorService getConnectExecutor()
connectThreadFactory() in the builder docpublic java.util.List<java.util.function.Consumer<io.nats.client.support.HttpRequest>> getHttpRequestInterceptors()
public java.net.Proxy getProxy()
public ErrorListener getErrorListener()
errorListener() in the builder docpublic TimeTraceLogger getTimeTraceLogger()
public ConnectionListener getConnectionListener()
connectionListener() in the builder docpublic ReadListener getReadListener()
readListener() in the builder docpublic StatisticsCollector getStatisticsCollector()
statisticsCollector() in the builder docpublic AuthHandler getAuthHandler()
authHandler() in the builder docpublic ReconnectDelayHandler getReconnectDelayHandler()
reconnectDelayHandler() in the builder docpublic java.lang.String getDataPortType()
dataPortType() in the builder docpublic io.nats.client.impl.DataPort buildDataPort()
public java.util.List<java.net.URI> getServers()
servers() in the builder docpublic java.util.List<io.nats.client.support.NatsUri> getNatsServerUris()
servers() in the builder docpublic java.util.List<java.lang.String> getUnprocessedServers()
public boolean isNoRandomize()
noRandomize() in the builder docpublic boolean isNoResolveHostnames()
noResolveHostnames() in the builder docpublic boolean isReportNoResponders()
reportNoResponders() in the builder docpublic java.lang.String getConnectionName()
connectionName() in the builder docpublic boolean isVerbose()
verbose() in the builder docpublic boolean isNoEcho()
noEcho() in the builder docpublic boolean isNoHeaders()
noHeaders() in the builder docpublic boolean isNoNoResponders()
noNoResponders() in the builder docpublic boolean clientSideLimitChecks()
public boolean supportUTF8Subjects()
supportUTF8Subjects() in the builder doc.public boolean isPedantic()
pedantic() in the builder docpublic boolean isTrackAdvancedStats()
turnOnAdvancedStats() in the builder docpublic boolean isTraceConnection()
public int getMaxControlLine()
maxControlLine() in the builder docpublic boolean isTLSRequired()
secure() in the builder docpublic javax.net.ssl.SSLContext getSslContext()
secure() in the builder docpublic int getMaxReconnect()
maxReconnects() in the builder docpublic java.time.Duration getReconnectWait()
reconnectWait() in the builder docpublic java.time.Duration getReconnectJitter()
reconnectJitter() in the builder docpublic java.time.Duration getReconnectJitterTls()
reconnectJitterTls() in the builder docpublic java.time.Duration getConnectionTimeout()
connectionTimeout() in the builder docpublic int getSocketReadTimeoutMillis()
socketReadTimeoutMillis in the builder docpublic java.time.Duration getSocketWriteTimeout()
socketWriteTimeout in the builder docpublic int getSocketSoLinger()
socketSoLinger() in the builder docpublic int getReceiveBufferSize()
public int getSendBufferSize()
public java.time.Duration getPingInterval()
pingInterval() in the builder docpublic java.time.Duration getRequestCleanupInterval()
requestCleanupInterval() in the builder docpublic int getMaxPingsOut()
maxPingsOut() in the builder docpublic long getReconnectBufferSize()
reconnectBufferSize() in the builder docpublic int getBufferSize()
bufferSize() in the builder doc@Deprecated public java.lang.String getUsername()
userInfo() in the builder docpublic char[] getUsernameChars()
userInfo() in the builder doc@Deprecated public java.lang.String getPassword()
userInfo() in the builder docpublic char[] getPasswordChars()
userInfo() in the builder doc@Deprecated public java.lang.String getToken()
token() in the builder docpublic char[] getTokenChars()
token() in the builder doc
generated from the token supplier if the user supplied one.public boolean isOldRequestStyle()
oldStyleRequest() in the builder docpublic java.lang.String getInboxPrefix()
inboxPrefix() in the builder docpublic int getMaxMessagesInOutgoingQueue()
maxMessagesInOutgoingQueue(int) in the builder docpublic boolean isDiscardMessagesWhenOutgoingQueueFull()
discardMessagesWhenOutgoingQueueFull() in the builder docpublic boolean isIgnoreDiscoveredServers()
public boolean isTlsFirst()
public boolean useTimeoutException()
TimeoutException on timeout instead of CancellationException.public boolean useDispatcherWithExecutor()
public boolean forceFlushOnRequest()
public ServerPool getServerPool()
public io.nats.client.impl.DispatcherFactory getDispatcherFactory()
public boolean isEnableFastFallback()
public java.net.URI createURIForServer(java.lang.String serverURI)
throws java.net.URISyntaxException
serverURI - the text urijava.net.URISyntaxException - if the text version is malformed or illegalpublic java.nio.CharBuffer buildProtocolConnectOptionsString(java.lang.String serverURI,
boolean includeAuth,
byte[] nonce)
serverURI - the current server uriincludeAuth - tells the options to build a connection string that includes auth informationnonce - if the client is supposed to sign the nonce for authentication