Skip to content

Commit 5b5c329

Browse files
author
Stephen Asbury
committed
Started rename for gnatsd to nats-server.
1 parent ea620bd commit 5b5c329

File tree

13 files changed

+40
-37
lines changed

13 files changed

+40
-37
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jdk:
88
- openjdk9
99
- openjdk10
1010
before_script:
11-
- wget "https://github.com/nats-io/gnatsd/releases/download/$gnatsd_version/gnatsd-$gnatsd_version-linux-amd64.zip"
11+
- wget "https://github.com/nats-io/nats-server/releases/download/$nats_server_version/gnatsd-$nats_server_version-linux-amd64.zip"
1212
-O tmp.zip
1313
- unzip tmp.zip
14-
- mv gnatsd-$gnatsd_version-linux-amd64 gnatsd
14+
- mv gnatsd-$nats_server_version-linux-amd64 nats-server
1515
before_install:
1616
- openssl aes-256-cbc -K $encrypted_f07928735f08_key -iv $encrypted_f07928735f08_iv
1717
-in .travis/nats.travis.gpg.enc -out .travis/nats.travis.gpg -d
@@ -32,8 +32,8 @@ after_success:
3232
#Disable for now, upload archives fails because of IP address changes - "test ${TRAVIS_PULL_REQUEST} != 'true' && test ${TRAVIS_BRANCH} = 'master' && ./gradlew closeAndReleaseRepository"
3333
env:
3434
global:
35-
- gnatsd_version=v1.3.0
36-
- gnatsd_path=$TRAVIS_BUILD_DIR/gnatsd/gnatsd
35+
- nats_server_version=v1.4.0
36+
- nats_server_path=$TRAVIS_BUILD_DIR/nats-server/gnatsd
3737
- GPG_KEYRING_FILE=.travis/nats.travis.gpg
3838
- secure: yvOfk7kJzzTQ38n444jTDets24FZmxewwb3lrhXwpHTwOnQyq/B8QaHeqvhneECMc0Bq5M4blTlJ/wOWJAvs61POv2QVkyw+u8cVNROzkb8GPaH4ybPo8HMl33EHFNqh1KRo2C9hAPMYbbTjKCVY2UdkdfJ2l4lN/Awk7uEDX8ckc/sENhDeQjY/xoGZUP28O568Eg4ZxN3fr3WEV/0T+R15YyL2X0ev8MiGJM5TojXnNFKdb5fk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ndbM8NHsup5FfmALfq2bGIpe4USIqoOAZFUSa35hPDW87C7Z4vvPvb9I=

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [FIXED] - #231 - found a problem with message ordering when filtering pings on reconnect, caused issues with reconnect in general
88
* [FIXED] - #226 - added more doc about ping intervals and max ping
99
* [FIXED] - #224 - resolved a latency problem with windows due to the cost of the message queues spinwait/lock
10+
* [CHANGED] - started support for renaming gnatsd to nats-server, full release isn't done so using gnatsd for tests still
1011

1112
## Version 2.4.3
1213

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ A [Java](http://java.com) client for the [NATS messaging system](https://nats.io
1212

1313
## A Note on Versions
1414

15+
The NATS server renamed itself from gnatsd to nats-server around 2.4.4. This and other files try to use the new names, but some underlying code may change over several versions. If you are building yourself, please keep an eye out for issues and report them.
16+
1517
This is version 2.1 of the java-nats library. This version is a ground up rewrite of the original library. Part of the goal of this re-write was to address the excessive use of threads, we created a Dispatcher construct to allow applications to control thread creation more intentionally. This version also removes all non-JDK runtime dependencies.
1618

1719
The API is [simple to use](#listening-for-incoming-messages) and highly [performant](#Benchmarking).
@@ -101,7 +103,7 @@ NATS uses RNG to generate unique inbox names. A peculiarity of the JDK on Linux
101103

102104
## Basic Usage
103105

104-
Sending and receiving with NATS is as simple as connecting to the gnatsd and publishing or subscribing for messages. A number of examples are provided in this repo as described in [examples.md](src/examples/java/io/nats/examples/examples.md).
106+
Sending and receiving with NATS is as simple as connecting to the nats-server and publishing or subscribing for messages. A number of examples are provided in this repo as described in [examples.md](src/examples/java/io/nats/examples/examples.md).
105107

106108
### Connecting
107109

@@ -232,7 +234,7 @@ If you want to try out these techniques, take a look at the [examples.md](src/ex
232234

233235
### Clusters & Reconnecting
234236

235-
The Java client will automatically reconnect if it loses its connection the gnatsd. If given a single server, the client will keep trying that one. If given a list of servers, the client will rotate between them. When the gnatsd servers are in a cluster, they will tell the client about the other servers, so that in the simplest case a client could connect to one server, learn about the cluster and reconnect to another server if its initial one goes down.
237+
The Java client will automatically reconnect if it loses its connection the nats-server. If given a single server, the client will keep trying that one. If given a list of servers, the client will rotate between them. When the nats servers are in a cluster, they will tell the client about the other servers, so that in the simplest case a client could connect to one server, learn about the cluster and reconnect to another server if its initial one goes down.
236238

237239
To tell the connection about multiple servers for the initial connection, use the `servers()` method on the options builder, or call `server()` multiple times.
238240

@@ -245,7 +247,7 @@ Reconnection behavior is controlled via a few options, see the javadoc for the O
245247

246248
## Benchmarking
247249

248-
The `io.nats.examples` package contains two benchmarking tools, modeled after tools in other NATS clients. Both examples run against an existing gnatsd. The first called `io.nats.examples.benchmark.NatsBench` runs two simple tests, the first simply publishes messages, the second also receives messages. Tests are run with 1 thread/connection per publisher or subscriber. Running on an iMac (2017), with 4.2 GHz Intel Core i7 and 64GB of memory produced results like:
250+
The `io.nats.examples` package contains two benchmarking tools, modeled after tools in other NATS clients. Both examples run against an existing nats-server. The first called `io.nats.examples.benchmark.NatsBench` runs two simple tests, the first simply publishes messages, the second also receives messages. Tests are run with 1 thread/connection per publisher or subscriber. Running on an iMac (2017), with 4.2 GHz Intel Core i7 and 64GB of memory produced results like:
249251

250252
```AsciiDoc
251253
Starting benchmark(s) [msgs=5000000, msgsize=256, pubs=2, subs=2]
@@ -371,7 +373,7 @@ The java doc is located in `build/docs` and the example jar is in `build/libs`.
371373

372374
which will create a folder called `build/reports/jacoco` containing the file `index.html` you can open and use to browse the coverage. Keep in mind we have focused on library test coverage, not coverage for the examples.
373375

374-
Many of the tests run gnatsd on a custom port. If gnatsd is in your path they should just work, but in cases where it is not, or an IDE running tests has issues with the path you can specify the gnatsd location with the environment variable `gnatsd_path`.
376+
Many of the tests run nats-server on a custom port. If nats-server is in your path they should just work, but in cases where it is not, or an IDE running tests has issues with the path you can specify the nats-server location with the environment variable `nats_-_server_path`.
375377

376378
## License
377379

src/examples/java/io/nats/examples/autobench/NatsAutoBench.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static void main(String args[]) {
6868
}
6969
}
7070

71-
System.out.printf("Connecting to gnatsd at %s\n", server);
71+
System.out.printf("Connecting to NATS server at %s\n", server);
7272

7373
try {
7474
Options.Builder builder = new Options.Builder().

src/examples/java/io/nats/examples/examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ To run with the completely unverified client:
3939
java -cp build/libs/jnats-2.0.0.jar:build/libs/jnats-examples-2.0.0.jar io.nats.examples.NatsSub opentls://localhost:4443 test 3
4040
```
4141

42-
There are a set tls configuration for the server in the test files that can be used to run gnatsd.
42+
There are a set tls configuration for the server in the test files that can be used to run the NATS server.
4343

4444
```bash
45-
gnatsd --conf src/test/resources/tls.conf
45+
nats-server --conf src/test/resources/tls.conf
4646
```
4747

4848
As well as one with the verify flag set.
4949

5050
```bash
51-
gnatsd --conf src/test/resources/tlsverify.conf
51+
nats-server --conf src/test/resources/tlsverify.conf
5252
```
5353

5454
which will require client certificates.

src/main/java/io/nats/client/Connection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/**
2222
* The Connection class is at the heart of the NATS Java client. Fundamentally a connection represents
23-
* a single network connection to the gnatsd server.
23+
* a single network connection to the NATS server.
2424
*
2525
* <p>Each connection you create will result in the creation of a single socket and several threads:
2626
* <ul>
@@ -72,7 +72,7 @@
7272
*
7373
* <p><em>Note</em>: The publish methods take an array of bytes. These arrays <strong>will not be copied</strong>. This design choice
7474
* is based on the common case of strings or objects being converted to bytes. Once a client can be sure a message was received by
75-
* the gnatsd it is theoretically possible to reuse that byte array, but this pattern should be treated as advanced and only used
75+
* the NATS server it is theoretically possible to reuse that byte array, but this pattern should be treated as advanced and only used
7676
* after thorough testing.
7777
*/
7878
public interface Connection extends AutoCloseable {

src/main/java/io/nats/client/ConnectionListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
public interface ConnectionListener {
2121
public enum Events {
22-
/** The connection has successfully completed the handshake with the gnatsd. */
22+
/** The connection has successfully completed the handshake with the nats-server. */
2323
CONNECTED("nats: connection opened"),
2424
/** The connection is permanently closed, either by manual action or failed reconnects. */
2525
CLOSED("nats: connection closed"),

src/main/java/io/nats/client/Nats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
/**
2121
* The Nats class is the entry point into the NATS client for Java. This class
22-
* is used to create a connection to the Nats server, gnatsd. Connecting is a
22+
* is used to create a connection to the NATS server. Connecting is a
2323
* synchronous process, with a new asynchronous version available for experimenting.
2424
*
2525
* <p>Simple connections can be created with a URL, while more control is provided
2626
* when an {@link Options Options} object is used. There are a number of options that
2727
* effect every connection, as described in the {@link Options Options} documentation.
2828
*
29-
* <p>At its simplest, you can connect to a gnatsd on the local host using the default port with:
29+
* <p>At its simplest, you can connect to a nats-server on the local host using the default port with:
3030
* <pre>Connection nc = Nats.connect()</pre>
3131
* <p>and start sending or receiving messages immediately after that.
3232
*

src/main/java/io/nats/client/Options.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public Builder oldRequestStyle() {
709709
/**
710710
* Turn off server pool randomization. By default the server will pick
711711
* servers from its list randomly on a reconnect. When set to noRandom the server
712-
* goes in the order they were configured or provided by gnatsd.
712+
* goes in the order they were configured or provided by a server in a cluster update.
713713
* @return the Builder for chaining
714714
*/
715715
public Builder noRandomize() {
@@ -718,7 +718,7 @@ public Builder noRandomize() {
718718
}
719719

720720
/**
721-
* Turn off echo. If supported by the gnatsd version you are connecting to this
721+
* Turn off echo. If supported by the nats-server version you are connecting to this
722722
* flag will prevent the server from echoing messages back to the connection if it
723723
* has subscriptions on the subject being published to.
724724
* @return the Builder for chaining

src/main/java/io/nats/client/impl/NatsConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void connect(boolean reconnectOnConnect) throws InterruptedException, IOExceptio
190190
reconnect();
191191
} else {
192192
close();
193-
throw new IOException("Unable to connect to gnatsd server.");
193+
throw new IOException("Unable to connect to NATS server.");
194194
}
195195
}
196196
}

0 commit comments

Comments
 (0)