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
Constant used for calculating if a socket read timeout is large enough.
|
static long |
MINIMUM_SOCKET_WRITE_TIMEOUT_GT_CONNECTION_TIMEOUT
Constant used for calculating if a socket write timeout is large enough.
|
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_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_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_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_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() |
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() |
java.net.URI |
createURIForServer(java.lang.String serverURI) |
boolean |
forceFlushOnRequest()
Whether to flush on any user request
|
AuthHandler |
getAuthHandler() |
int |
getBufferSize() |
java.util.concurrent.ExecutorService |
getCallbackExecutor() |
java.util.concurrent.ExecutorService |
getConnectExecutor() |
ConnectionListener |
getConnectionListener() |
java.lang.String |
getConnectionName() |
java.time.Duration |
getConnectionTimeout() |
java.lang.String |
getDataPortType() |
io.nats.client.impl.DispatcherFactory |
getDispatcherFactory()
Get the DispatcherFactory implementation.
|
ErrorListener |
getErrorListener() |
java.util.concurrent.ExecutorService |
getExecutor() |
java.util.List<java.util.function.Consumer<HttpRequest>> |
getHttpRequestInterceptors() |
java.lang.String |
getInboxPrefix() |
int |
getMaxControlLine() |
int |
getMaxMessagesInOutgoingQueue() |
int |
getMaxPingsOut() |
int |
getMaxReconnect() |
java.util.List<NatsUri> |
getNatsServerUris() |
java.lang.String |
getPassword()
Deprecated.
converts the char array to a string, use getPasswordChars instead for more security
|
char[] |
getPasswordChars() |
java.time.Duration |
getPingInterval() |
java.net.Proxy |
getProxy() |
ReadListener |
getReadListener() |
long |
getReconnectBufferSize() |
ReconnectDelayHandler |
getReconnectDelayHandler() |
java.time.Duration |
getReconnectJitter() |
java.time.Duration |
getReconnectJitterTls() |
java.time.Duration |
getReconnectWait() |
java.time.Duration |
getRequestCleanupInterval() |
ServerPool |
getServerPool()
Get the ServerPool implementation.
|
java.util.List<java.net.URI> |
getServers() |
int |
getSocketReadTimeoutMillis() |
int |
getSocketSoLinger() |
java.time.Duration |
getSocketWriteTimeout() |
javax.net.ssl.SSLContext |
getSslContext() |
StatisticsCollector |
getStatisticsCollector() |
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() |
java.util.List<java.lang.String> |
getUnprocessedServers() |
java.lang.String |
getUsername()
Deprecated.
converts the char array to a string, use getUserNameChars instead for more security
|
char[] |
getUsernameChars() |
boolean |
isDiscardMessagesWhenOutgoingQueueFull() |
boolean |
isIgnoreDiscoveredServers()
Get whether to ignore discovered servers
|
boolean |
isNoEcho() |
boolean |
isNoHeaders() |
boolean |
isNoNoResponders() |
boolean |
isNoRandomize() |
boolean |
isNoResolveHostnames() |
boolean |
isOldRequestStyle() |
boolean |
isPedantic() |
boolean |
isReportNoResponders() |
boolean |
isTlsFirst()
Get whether to do tls first
|
boolean |
isTLSRequired() |
boolean |
isTraceConnection()
If isTraceConnection is true, the user provided a TimeTraceLogger or manually called traceConnection in the builder
|
boolean |
isTrackAdvancedStats() |
boolean |
isVerbose() |
void |
setOldRequestStyle(boolean value)
Deprecated.
Use Builder
|
boolean |
supportUTF8Subjects() |
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 minutepublic static final long MINIMUM_SOCKET_WRITE_TIMEOUT_GT_CONNECTION_TIMEOUT
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_QUEUE
public 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_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_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_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
.@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.ExecutorService getCallbackExecutor()
callbackThreadFactory()
in the builder docpublic java.util.concurrent.ExecutorService getConnectExecutor()
connectThreadFactory()
in the builder docpublic java.util.List<java.util.function.Consumer<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<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 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 docpublic 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 java.net.URI createURIForServer(java.lang.String serverURI) throws java.net.URISyntaxException
java.net.URISyntaxException
public 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