public class NatsStreaming extends NatsBase
NATS_PREFIX| Constructor and Description |
|---|
NatsStreaming()
Create
NatsStreaming without any start able configuration |
NatsStreaming(int port)
Create
NatsStreaming with the simplest start able configuration |
NatsStreaming(List<String> customArgs)
Create
NatsStreaming with custom args |
NatsStreaming(String... kv)
Create custom
NatsStreaming with the simplest configuration config(String...) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Map<NatsStreamingConfig,MapValue> |
config()
GetNatServerConfig
|
NatsStreaming |
config(Map<NatsStreamingConfig,String> config)
Configures the nats server
|
NatsStreaming |
config(NatsStreamingConfig key,
String value)
Configures the nats server
|
NatsStreaming |
config(String... kv)
Configures the nats server
|
NatsStreaming |
start()
Starts the server in
ProcessBuilder with the given config config(String...) |
NatsStreaming |
start(long timeoutMs)
Starts the server in
ProcessBuilder with the given config config(String...) |
NatsStreaming |
stop()
Stops the
ProcessBuilder and kills the NatsStreaming
Only a log error will occur if the NatsStreaming were never started |
NatsStreaming |
stop(long timeoutMs)
Stops the
ProcessBuilder and kills the NatsStreaming
Only a log error will occur if the NatsStreaming were never started |
NatsStreaming |
tryStart()
Starts the server in
ProcessBuilder with the given parameterConfig config(String...)
Throws all exceptions as RuntimeException |
NatsStreaming |
tryStart(long timeoutMs)
Starts the server in
ProcessBuilder with the given config config(String...)
Throws all exceptions as RuntimeException |
public NatsStreaming()
NatsStreaming without any start able configurationpublic NatsStreaming(List<String> customArgs)
NatsStreaming with custom argspublic NatsStreaming(int port)
NatsStreaming with the simplest start able configurationport - start port, -1 = random, default is 4222public NatsStreaming(String... kv)
NatsStreaming with the simplest configuration config(String...)kv - passes the original parameters to the server. example: port:4222, user:admin, password:adminpublic Map<NatsStreamingConfig,MapValue> config()
NatsStreaming configurationpublic NatsStreaming config(NatsStreamingConfig key, String value)
NatsStreaming configurationpublic NatsStreaming config(Map<NatsStreamingConfig,String> config)
config - passes the original parameters to the server.NatsStreamingconfig(String...),
NatsStreamingConfigpublic NatsStreaming config(String... kv)
kv - example: port, 4222, user, admin, password, adminNatsStreamingNatsStreamingConfigpublic NatsStreaming tryStart()
ProcessBuilder with the given parameterConfig config(String...)
Throws all exceptions as RuntimeExceptionNatsStreamingpublic NatsStreaming tryStart(long timeoutMs)
ProcessBuilder with the given config config(String...)
Throws all exceptions as RuntimeExceptiontimeoutMs - defines the start-up timeout -1 no timeout, else waits until port upNatsStreamingpublic NatsStreaming start() throws Exception
ProcessBuilder with the given config config(String...)NatsStreamingIOException - if NatsStreaming is not found or unsupported on the SystemUtilBindException - if port is already takenPortUnreachableException - if NatsStreaming is not starting cause port is not freeExceptionpublic NatsStreaming start(long timeoutMs) throws Exception
ProcessBuilder with the given config config(String...)timeoutMs - defines the start-up timeout -1 no timeout, else waits until port upNatsStreamingIOException - if NatsStreaming is not found or unsupported on the SystemUtilBindException - if port is already takenPortUnreachableException - if NatsStreaming is not starting cause port is not freeExceptionpublic void close()
public NatsStreaming stop()
ProcessBuilder and kills the NatsStreaming
Only a log error will occur if the NatsStreaming were never startedNatsStreamingpublic NatsStreaming stop(long timeoutMs)
ProcessBuilder and kills the NatsStreaming
Only a log error will occur if the NatsStreaming were never startedtimeoutMs - defines the tear down timeout, -1 no timeout, else waits until port is free againNatsStreamingCopyright © 2022. All rights reserved.