brimworks / java-nats-server-runner

Run the Nats Server From your Java code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NATS

Java Nats Server Runner

Run the NATS messaging system Server from your Java code.

License Apache 2 Maven Central Javadoc Release Badge

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());
    
    ...
}

License

Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

About

Run the Nats Server From your Java code.

License:Apache License 2.0


Languages

Language:Java 100.0%