public static final class Options.Builder
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
Builder() |
Builder(Options template)
Constructs a
Options.Builder instance based on the supplied Options
instance. |
| Modifier and Type | Method and Description |
|---|---|
Options |
build()
Construct the options object.
|
Options.Builder |
connectionListener(io.nats.client.ConnectionListener listener)
Provide an connection listener to use when creating the nats connection.
|
Options.Builder |
connectWait(java.time.Duration connectTimeout)
Set the connect timeout
|
Options.Builder |
discoverPrefix(java.lang.String discoverPrefix)
Set the discovery prefix
|
Options.Builder |
errorListener(io.nats.client.ErrorListener listener)
Provide an error listener to use when creating the nats connection.
|
Options.Builder |
maxPubAcksInFlight(int maxPubAcksInFlight)
Set the max pub acks the server/client will allow
|
Options.Builder |
natsConn(io.nats.client.Connection natsConn)
Manually set the NATS connection
|
Options.Builder |
natsUrl(java.lang.String natsUrl)
Set the url to connect to for NATS
|
Options.Builder |
pubAckWait(java.time.Duration ackTimeout)
Set the ack timeout
|
public Builder()
public Builder(Options template)
Options.Builder instance based on the supplied Options
instance.template - the Options object to use as a templatepublic Options.Builder errorListener(io.nats.client.ErrorListener listener)
listener - the ErrorListenerpublic Options.Builder connectionListener(io.nats.client.ConnectionListener listener)
listener - the ConnectionListenerpublic Options.Builder pubAckWait(java.time.Duration ackTimeout)
ackTimeout - the timeoutpublic Options.Builder connectWait(java.time.Duration connectTimeout)
connectTimeout - the timeoutpublic Options.Builder discoverPrefix(java.lang.String discoverPrefix)
discoverPrefix - the prefix, defaults to
DEFAULT_DISCOVER_PREFIX.public Options.Builder maxPubAcksInFlight(int maxPubAcksInFlight)
maxPubAcksInFlight - the max ackspublic Options.Builder natsConn(io.nats.client.Connection natsConn)
natsConn - a valid nats connection (from the latest version of the
library)public Options.Builder natsUrl(java.lang.String natsUrl)
natsUrl - a valid nats url, see the client library for more informationpublic Options build()