Run the NATS messaging system Server from your Java code.
Useful for running unit or integration tests on the localhost.
By default, the server must be in your path under the name nats-server
or you must set the nats_server_path
environment variable.
try (NatsServerRunner server = new NatsServerRunner()) {
System.out.println("Server running on port: " + server.getPort())
Connection c = Nats.connect(server.getURI());
...
}
Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.