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 |
clientId(java.lang.String clientId)
Set the client id for connections made with these options.
|
Options.Builder |
clusterId(java.lang.String clusterId)
Set the cluster id
|
Options.Builder |
connectionListener(io.nats.client.ConnectionListener listener)
Provide an connection listener to use when creating the nats connection.
|
Options.Builder |
connectionLostHandler(ConnectionLostHandler handler)
Provide an lost handler to be notified if the streaming server doesn't
answer the client's pings.
|
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.
|
java.lang.String |
getClientId() |
java.lang.String |
getClusterID() |
Options.Builder |
maxPingsOut(int max)
Set the max pings that can be out to the server before it is considered lost.
|
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 |
pingInterval(java.time.Duration interval)
Set the time between pings to the server, if it is supported.
|
Options.Builder |
pubAckWait(java.time.Duration ackTimeout)
Set the ack timeout
|
Options.Builder |
traceConnection()
Enable connection trace messages.
|
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 clusterId(java.lang.String clusterId)
clusterId - the id for the streaming cluster ot connect to.public java.lang.String getClusterID()
public Options.Builder clientId(java.lang.String clientId)
clientId - the id for the streaming cluster ot connect to.public java.lang.String getClientId()
public Options.Builder errorListener(io.nats.client.ErrorListener listener)
listener - the ErrorListenerpublic Options.Builder connectionListener(io.nats.client.ConnectionListener listener)
listener - the ConnectionListenerpublic Options.Builder connectionLostHandler(ConnectionLostHandler handler)
handler - the ConnectionLostHandlerpublic 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.Builder maxPingsOut(int max)
max - the maxPings outpublic Options.Builder pingInterval(java.time.Duration interval)
interval - the time between server pingspublic Options build()
public Options.Builder traceConnection()