Class NatsStreamingServer
- java.lang.Object
-
- berlin.yuna.natsserver.logic.NatsStreaming
-
- berlin.yuna.natsserver.streaming.embedded.logic.NatsStreamingServer
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
public class NatsStreamingServer extends berlin.yuna.natsserver.logic.NatsStreaming implements org.springframework.beans.factory.DisposableBean
-
-
Constructor Summary
Constructors Constructor Description NatsStreamingServer(long timeoutMs)
CreateNatsStreamingServer
with simplest start able configurationNatsStreamingServer(long timeoutMs, String... natsServerConfig)
Create customNatsStreamingServer
with simplest configurationNatsStreaming.config(String...)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Simply stops theNatsStreamingServer
protected Path
getNatsServerPath(berlin.yuna.clu.logic.SystemUtil.OperatingSystem operatingSystem)
NatsStreamingServer
port(int port)
Sets the port out of the configurationNatsStreamingServer
source(String natsServerUrl)
Url to find nats server source
-
-
-
Field Detail
-
BEAN_NAME
public static final String BEAN_NAME
-
-
Constructor Detail
-
NatsStreamingServer
public NatsStreamingServer(long timeoutMs, String... natsServerConfig)
Create customNatsStreamingServer
with simplest configurationNatsStreaming.config(String...)
- Parameters:
timeoutMs
- tear down timeoutnatsServerConfig
- passes the original parameters to the server. example: port:4222, user:admin, password:admin
-
NatsStreamingServer
public NatsStreamingServer(long timeoutMs)
CreateNatsStreamingServer
with simplest start able configuration- Parameters:
timeoutMs
- tear down timeout
-
-
Method Detail
-
port
public NatsStreamingServer port(int port)
Sets the port out of the configuration- Overrides:
port
in classberlin.yuna.natsserver.logic.NatsStreaming
- Parameters:
port
--1
for random port- Returns:
NatsStreamingServer
- Throws:
RuntimeException
- withConnectException
when there is no port configured
-
source
public NatsStreamingServer source(String natsServerUrl)
Url to find nats server source- Overrides:
source
in classberlin.yuna.natsserver.logic.NatsStreaming
- Parameters:
natsServerUrl
- url of the sourceNatsStreamingSourceConfig
- Returns:
NatsStreamingServer
-
getNatsServerPath
protected Path getNatsServerPath(berlin.yuna.clu.logic.SystemUtil.OperatingSystem operatingSystem)
- Overrides:
getNatsServerPath
in classberlin.yuna.natsserver.logic.NatsStreaming
-
destroy
public void destroy()
Simply stops theNatsStreamingServer
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- See Also:
NatsStreaming.stop()
-
-