Skip to content

Commit 831274f

Browse files
authored
Addressing signing issues (#443)
* 2.10.2 * 2.10.2 again * 2.10.3 * addressing signing issues * addressing signing issues * addressing signing issues (3) * addressing signing issues (4) * this test never worked, but the build still passed? * this test never worked, but the build still passed? (2) * fixing the build (1) * fixing the build (2) reverting to older gradle because travis * fixing the build (3) * fixing the build (4) * fixing the build (5) * fixing the build (6) trying focal * fixing the build (7) trying bionic * fixing the build (7) trying xenial * fixing the build (8) back to focal and open jdk * fixing the build (9) travis!!! * fixing the build (10) travis!!! * fixing the build (11) can I just install them myself * fixing the build (12) can I just install them myself * fixing the build (13) * fixing the build (14) * fixing the build (15) * fixing the build (16) * fixing the build (17) * fixing the build (18) * fixing the build (19) * fixing the build (20) * fixing the build (21) * fixing the build (22) * fixing the build (23) * fixing the build (24) * fixing the build (25) * fixing the build (26) * fixing the build (27) * fixing the build (28) * fixing the build (30) * fixing the build (31) * fixing the build (32) * fixing the build (33) * fixing the build (34) * fixing the build (35) * fixing the build (36) * fixing the build (37) * fixing the build (38-PRE-RC1) * fixing the build (39) keep your fingers crossed
1 parent d063b2c commit 831274f

File tree

8 files changed

+81
-72
lines changed

8 files changed

+81
-72
lines changed

.travis.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
dist: trusty
1+
dist: xenial
22
language: java
33
sudo: required
44
jdk:
5-
# - openjdk8
6-
# - openjdk9
7-
# - openjdk10
8-
# - openjdk11
9-
# - openjdk12
10-
# - openjdk13
11-
# - openjdk14
12-
# - openjdk15
13-
- oraclejdk8
14-
# - oraclejdk9
5+
- openjdk8
156
before_script:
167
- bash install_deps.sh
178
before_install:
@@ -23,8 +14,8 @@ before_install:
2314
install:
2415
- "./gradlew assemble"
2516
script:
17+
# test are run b/c check depends on test
2618
- "./gradlew check"
27-
#for testing - "./gradlew build -x test"
2819
before_cache:
2920
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
3021
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
@@ -33,19 +24,19 @@ cache:
3324
- "$HOME/.gradle/caches/"
3425
- "$HOME/.gradle/wrapper/"
3526
after_success:
36-
- "./gradlew test jacocoTestReport coveralls"
27+
# tests (and checks) have completed successfully
28+
- "./gradlew jacocoTestReport coveralls"
29+
# TRAVIS_BRANCH equals TRAVIS_TAG when a tag exists
3730
- |
38-
if [ "${TRAVIS_SECURE_ENV_VARS}" == "true" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_JDK_VERSION}" == "oraclejdk8" ]; then
39-
./gradlew -i publishToSonatype
40-
fi
41-
- |
42-
if [ "${TRAVIS_SECURE_ENV_VARS}" == "true" ] && [ "${TRAVIS_BRANCH}" == "${TRAVIS_TAG}" ] && [ ! -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_JDK_VERSION}" == "oraclejdk8" ]; then
43-
./gradlew -i sign publishToSonatype closeAndReleaseRepository
31+
if [ "${TRAVIS_SECURE_ENV_VARS}" == "true" ]; then
32+
if [ "${TRAVIS_BRANCH}" == "main" ]; then
33+
./gradlew -i publishToSonatype
34+
elif [ "${TRAVIS_BRANCH}" == "${TRAVIS_TAG}" ]; then
35+
./gradlew -i sign publishToSonatype closeAndReleaseRepository
36+
fi
4437
fi
45-
4638
env:
4739
global:
48-
- nats_server_version=v2.1.2
4940
- nats_server_path=$TRAVIS_BUILD_DIR/nats-server/nats-server
5041
- GPG_KEYRING_FILE=.travis/nats.travis.gpg
5142
- secure: yvOfk7kJzzTQ38n444jTDets24FZmxewwb3lrhXwpHTwOnQyq/B8QaHeqvhneECMc0Bq5M4blTlJ/wOWJAvs61POv2QVkyw+u8cVNROzkb8GPaH4ybPo8HMl33EHFNqh1KRo2C9hAPMYbbTjKCVY2UdkdfJ2l4lN/Awk7uEDX8ckc/sENhDeQjY/xoGZUP28O568Eg4ZxN3fr3WEV/0T+R15YyL2X0ev8MiGJM5TojXnNFKdb5fkUodRWwiY8JDn5xzP7xUzzen7MqE/5YNTcIC6haU8LToJM2gXEQtdoWLZqMPWr7k4A+eTBO5vl9qWrPBaOodFJYKzEjrEDfHj5RR9uaufEsnwQzXKw1ODrIFVZiC2n73j/tatWDI+vjnJ5tO+VMwWj53qdBYrvYeyewIT3cz9rrDHH8fGINsKAsk6HgWM3SMgeNSuXjRN0ePxEph5FVQ3ZUjF1ZXp90O7kjD5kXg/jVs6GrhCviRT3fx6Z4hyat9ytshy66jqcttHEfJ5sSOBg8fVbWJjLbxmghWUFp1fuc0HGNiMJStEyOBai5AkG6uJccTlgjlNL/8mgEF+fxo8HGVyStQzRnr7LJuCmWW9hx/aBVmqXR4p6cRgsSO09PvHRmcsLQoktCxVxsvcfblQqMbiQKjsJ4tXLe0U88DMOHnEGOgtik/tt+4=

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
11

22
# Change Log
33

4+
## Version 2.10.0
5+
6+
1. JetStream (message and management) support added.
7+
1. Miscellaneous bug fixes.
8+
1. Examples and benchmarks updated
9+
1. Improved unit tests with reusable scaffolding
10+
1. General Improvements
11+
12+
#### Non JetStream Pull Requests
13+
- [GENERAL] PR #358 Use OS Default SecureRandom (@scottf)
14+
- [BUILD] Issue #360 Automatic-Module-Name clause added to jar manifest. (@bjorndarri)
15+
- [BUILD] PR #365 gradle minor improvements, support windows (@scottf)
16+
- [TEST] PR #375 fix test failing because of timeout that aren't testing timing (@scottf)
17+
- [GENERAL] PR #380 Add a flushBuffer API (@ColinSullivan1)
18+
- [GENERAL] PR #383 nuid speed improvements (@scottf)
19+
- [GENERAL] PR #391 reconnect-jitter-handler-serverinfo-tests (@scottf)
20+
21+
#### Issue Features
22+
- [JETSTREAM] Issue #335 Add Message Headers (@scottf)
23+
- [GENERAL] Issue #336 Support no-responders (@scottf)
24+
- [JETSTREAM] Issue #353 Jetstream APIS (@ColinSullivan1) (@scottf)
25+
- [BUILD] Issue #355 Automatic module name (@bjorndarri)
26+
- [GENERAL] Issue #377 Add a flushBuffer Connection API (@ColinSullivan1) Added in PR #380
27+
- [JETSTREAM] Issue #393 Create Asynchronous Jetstream.Publish API (@scottf) Added in PR #398
28+
- [JETSTREAM] Issue #396 Jetstream Consumer Delete API (@scottf) Added in PR #408
29+
- [JETSTREAM] Issue #412 Add a JS management API to get consumer info (@scottf) Added in PR #413
30+
31+
#### Issue Bug Fixes
32+
- [FIXED] Issue #424 ERROR: Subject remapping requires Options.oldRequestStyle()... (@scottf)
33+
- [FIXED] Issue #345 "unable to stop reader thread" log message (@ColinSullivan1) Fixed in PR #427
34+
- [FIXED] Issue #310 NatsConnection.close unnecessarily sleeps for one second (@scottf)
35+
36+
#### Issues General
37+
- [COMMENTED] Issue #341 Why is a char[] more secure then a String for connection auth details? (@scottf)
38+
- [OTHER] Issue #384 Validations on expectedLastSeqence, expectedStream and expectedLastMsgId are not working for jetstream producer (fixed by nats-server PR #1787)
39+
440
## Version 2.8.0
541

642
- [ADDED] #323 Nats.connect v2 credentials (@olicuzo)

build.gradle

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,22 @@ plugins {
1515

1616
import aQute.bnd.gradle.Bundle
1717

18-
// Update version here, repeated check-ins not into master will have snapshot on them
19-
// Be sure to update Nats.java with the latest version, the change log and the package-info.java
20-
def versionMajor = 2
21-
def versionMinor = 10
22-
def versionPatch = 1
23-
def versionRevision = "" // Empty string when not using, otherwise include the dot, i.e. '.RC1' or '.Beta1' or '.123'
24-
def jarVersion = "" + versionMajor + "." + versionMinor + "." + versionPatch + versionRevision
18+
// Update version here
19+
// ** IMPORTANT ** BE SURE TO UPDATE THESE FILES WITH THE LATEST VERSION **
20+
// src/main/java/io/nats/client/Nats.java
21+
// src/main/java/io/nats/client/package-info.java
22+
// CHANGELOG.md
23+
def jarVersion = "2.10.0"
24+
25+
// TRAVIS_BRANCH equals TRAVIS_TAG when a tag exists / a tag event
2526
def secureEnv = System.getenv("TRAVIS_SECURE_ENV_VARS") != null ? System.getenv("TRAVIS_SECURE_ENV_VARS") : "false"
2627
def branch = System.getenv("TRAVIS_BRANCH") != null ? System.getenv("TRAVIS_BRANCH") : ""
2728
def tag = System.getenv("TRAVIS_TAG") != null ? System.getenv("TRAVIS_TAG") : ""
28-
def useSigning = "true" == secureEnv && ("master" == branch || ("" != tag && tag == branch)) // tag will be the branch on a tag event for travis
2929

30+
// we only sign when we have a tag which means a release (non -SNAPSHOT)
31+
def useSigning = "true" == secureEnv && tag == branch
32+
33+
// all releases that are not tagged from github will have snapshot on them
3034
def getVersionName = { ->
3135
if ("" == tag) {
3236
return jarVersion + "-SNAPSHOT"
@@ -134,7 +138,7 @@ javadoc {
134138
source = sourceSets.main.allJava
135139
title = "NATS.IO Java API"
136140
excludes = ['io/nats/client/impl', 'io/nats/examples',
137-
"io/nats/client/api/ConsumerCreateRequest.java"
141+
"io/nats/client/api/ConsumerCreateRequest.java"
138142
]
139143
classpath = sourceSets.main.runtimeClasspath
140144
doLast {
@@ -158,8 +162,8 @@ task examplesJar(type: Jar) {
158162
archiveClassifier.set('examples')
159163
manifest {
160164
attributes('Implementation-Title': 'Java Nats Examples',
161-
'Implementation-Version': jarVersion,
162-
'Implementation-Vendor': 'nats.io')
165+
'Implementation-Version': jarVersion,
166+
'Implementation-Vendor': 'nats.io')
163167
}
164168
from(sourceSets.main.output) {
165169
include "io/nats/examples/**"
@@ -181,8 +185,8 @@ task fatJar(type: Jar) {
181185
archiveClassifier.set('fat')
182186
manifest {
183187
attributes('Implementation-Title': 'Java Nats With Dependencies',
184-
'Implementation-Version': jarVersion,
185-
'Implementation-Vendor': 'nats.io')
188+
'Implementation-Version': jarVersion,
189+
'Implementation-Vendor': 'nats.io')
186190
}
187191
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
188192
with jar
@@ -304,4 +308,4 @@ publishing {
304308
}
305309
}
306310
}
307-
}
311+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public abstract class Nats {
7272
/**
7373
* Current version of the library - {@value}
7474
*/
75-
public static final String CLIENT_VERSION = "2.10.1";
75+
public static final String CLIENT_VERSION = "2.10.0";
7676

7777
/**
7878
* Current language of the library - {@value}

src/main/java/io/nats/client/api/ConsumerConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
package io.nats.client.api;
1515

16-
import io.nats.client.PublishOptions;
1716
import io.nats.client.support.JsonSerializable;
1817
import io.nats.client.support.JsonUtils;
1918

@@ -28,7 +27,7 @@
2827
/**
2928
* The ConsumerConfiguration class specifies the configuration for creating a JetStream consumer on the client and
3029
* if necessary the server.
31-
* Options are created using a {@link PublishOptions.Builder Builder}.
30+
* Options are created using a PublishOptions.Builder.
3231
*/
3332
public class ConsumerConfiguration implements JsonSerializable {
3433

src/main/java/io/nats/client/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
* use the {@link io.nats.client.Connection Connection} object to publish messages or create subscriptions.
1818
*
1919
* @since 2.0.0
20-
* @version 2.4.1
20+
* @version 2.10.0
2121
*/
2222
package io.nats.client;

src/test/java/io/nats/client/impl/DrainTests.java

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313

1414
package io.nats.client.impl;
1515

16-
import static org.junit.jupiter.api.Assertions.assertEquals;
17-
import static org.junit.jupiter.api.Assertions.assertFalse;
18-
import static org.junit.jupiter.api.Assertions.assertNotNull;
19-
import static org.junit.jupiter.api.Assertions.assertNull;
20-
import static org.junit.jupiter.api.Assertions.assertThrows;
21-
import static org.junit.jupiter.api.Assertions.assertTrue;
16+
import io.nats.client.*;
17+
import io.nats.client.ConnectionListener.Events;
18+
import org.junit.jupiter.api.Test;
2219

2320
import java.time.Duration;
2421
import java.time.Instant;
@@ -29,40 +26,22 @@
2926
import java.util.concurrent.atomic.AtomicReference;
3027
import java.util.concurrent.locks.LockSupport;
3128

32-
import org.junit.jupiter.api.Test;
33-
34-
import io.nats.client.Connection;
35-
import io.nats.client.Dispatcher;
36-
import io.nats.client.Message;
37-
import io.nats.client.Nats;
38-
import io.nats.client.NatsTestServer;
39-
import io.nats.client.Options;
40-
import io.nats.client.Subscription;
41-
import io.nats.client.TestHandler;
42-
import io.nats.client.ConnectionListener.Events;
29+
import static io.nats.client.utils.TestBase.standardConnection;
30+
import static org.junit.jupiter.api.Assertions.*;
4331

4432
public class DrainTests {
4533

4634
@Test
4735
public void testCloseOnDrainFailure() throws Exception {
48-
try (NatsTestServer ts = new NatsTestServer(false);
49-
final Connection subCon = Nats.connect(new Options.Builder().server(ts.getURI()).maxReconnects(0).build())){
50-
assertTrue(Connection.Status.CONNECTED == subCon.getStatus(), "Connected Status");
36+
try (NatsTestServer ts = new NatsTestServer(false)) {
37+
final Connection nc = standardConnection(new Options.Builder().server(ts.getURI()).maxReconnects(0).build());
5138

52-
Subscription sub = subCon.subscribe("draintest");
53-
subCon.flush(Duration.ofSeconds(1)); // Get the sub to the server, so drain has things to do
39+
nc.subscribe("draintest");
40+
nc.flush(Duration.ofSeconds(1)); // Get the sub to the server, so drain has things to do
5441

5542
ts.shutdown(); // shut down the server to fail drain and subsequent close
56-
boolean timedOut = false;
57-
try {
58-
subCon.drain(Duration.ofSeconds(1));
59-
} catch (java.util.concurrent.TimeoutException e) {
60-
timedOut = true;
61-
} finally {
62-
assertTrue(Connection.Status.CLOSED == subCon.getStatus(), "Expect closed connection");
63-
subCon.close(); // this is what I'd expect common code to do
64-
}
65-
assertTrue(timedOut, "Expect timeout exception");
43+
44+
assertThrows(Exception.class, () -> nc.drain(Duration.ofSeconds(1)));
6645
}
6746
}
6847

0 commit comments

Comments
 (0)