Skip to content

Commit

Permalink
Merge pull request #123 from nats-io/2.1.4
Browse files Browse the repository at this point in the history
2.1.4
  • Loading branch information
sasbury authored Apr 9, 2019
2 parents 8c7793e + 5caadc6 commit 72f964e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## Version 2.1.4

* [Fixed] - #121 - Set protobuf dependency to 3.6.1 to avoid breaking version.
* [Fixed] - #119 - Fixed issue with client ids in stan bench when multiple subscribers are used.
* [Fixed] - #95 - Made ack inbox publicly available on subscriber.

## Version 2.1.3

* [Added] Methods to include error and connection listener with factory #113
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A [Java](http://java.com) client for the [NATS streaming platform](https://nats.

## A Note on Versions

This is version 2.1 of the Java NATS streaming library. This version is a minor port to version 2.1 of the Java NATS library, but contains breaking changes due to the way the underlying library handles exceptions, especially timeouts.
This is version 2.1.4 of the Java NATS streaming library. This version is a port to version 2.x of the Java NATS library and contains breaking changes due to the way the underlying library handles exceptions, especially timeouts.

The new version minimizes threads. Only one thread is used for all callbacks, by relying on a dispatcher in the underlying NATS connection. If you want to deliver in multiple threads, you can use multiple StreamingConnections on the same underlying NATS connection. This reduces total thread usage while allowing callbacks to work independently. See [Sharing A NATS Connection](#sharing-a-nats-connection).

Expand All @@ -26,17 +26,17 @@ The nats streaming client requires two jar files to run, the java nats library a

### Downloading the Jar

You can download the latest NATS client jar at [https://search.maven.org/remotecontent?filepath=io/nats/jnats/2.1.0/jnats-2.1.0.jar](https://search.maven.org/remotecontent?filepath=io/nats/jnats/2.0.1/jnats-2.0.1.jar).
You can download the latest NATS client jar at [https://search.maven.org/remotecontent?filepath=io/nats/jnats/2.1.4/jnats-2.1.4.jar](https://search.maven.org/remotecontent?filepath=io/nats/jnats/2.1.4/jnats-2.1.4.jar).

You can download the latest java nats streaming jar at [https://search.maven.org/remotecontent?filepath=io/nats/java-nats-streaming/2.1.0/java-nats-streaming-2.1.0.jar](https://search.maven.org/remotecontent?filepath=io/nats/java-nats-streaming/2.1.0/java-nats-streaming-2.1.0.jar).
You can download the latest java nats streaming jar at [https://search.maven.org/remotecontent?filepath=io/nats/java-nats-streaming/2.1.4/java-nats-streaming-2.1.4.jar](https://search.maven.org/remotecontent?filepath=io/nats/java-nats-streaming/2.1.4/java-nats-streaming-2.1.4.jar).

### Using Gradle

The NATS client is available in the Maven central repository, and can be imported as a standard dependency in your `build.gradle` file:

```groovy
dependencies {
implementation 'io.nats:java-nats-streaming:2.1.0'
implementation 'io.nats:java-nats-streaming:2.1.4'
}
```

Expand All @@ -62,7 +62,7 @@ The NATS client is available on the Maven central repository, and can be importe
<dependency>
<groupId>io.nats</groupId>
<artifactId>java-nats-streaming</artifactId>
<version>2.1.0</version>
<version>2.1.4</version>
</dependency>
```

Expand Down Expand Up @@ -347,7 +347,7 @@ you have to close `two` before you close `one` to avoid an exception.
### Controlling Callback Threads
The underlying NATS library uses the concept of dispatchers to organize callback threads. You can leverage this feature in 2.1.0 or later of this
The underlying NATS library uses the concept of dispatchers to organize callback threads. You can leverage this feature in 2.1.4 or later of this
library by setting a dispatcher name on your subscriptions.
```java
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ plugins {
// Update version here, repeated check-ins not into master will have snapshot on them
def versionMajor = 2
def versionMinor = 1
def versionPatch = 3
def versionPatch = 4
def versionModifier = ""
def jarVersion = "2.1.3"
def jarVersion = "2.1.4"
def branch = System.getenv("TRAVIS_BRANCH");

def getVersionName = { ->
Expand Down Expand Up @@ -52,7 +52,7 @@ repositories {
}

dependencies {
compile 'com.google.protobuf:protobuf-java:[3.6,4.0)'
compile 'com.google.protobuf:protobuf-java:3.6.1'

testImplementation 'junit:junit:4.12'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void runSubscriber() throws Exception {
.natsConn(nc)
.build();

final StreamingConnection sc = NatsStreaming.connect(clusterId, clientId, opts);
final StreamingConnection sc = NatsStreaming.connect(clusterId, this.workerClientId, opts);
final SubscriptionOptions sopts;

if (ignoreOld) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
/**
* A {@code StreamingConnectionFactory} object encapsulates a set of connection configuration
* options. A client uses it to create a connection to the NATS streaming data system.
*
* This class provides some options that are mapped to the underlying NATS connection, but you can
* also create a streaming connection from an existing NATS core connection. Using an existing connection
* allows complete control over the core NATS options.
*/
public class StreamingConnectionFactory {
private Duration ackTimeout = SubscriptionOptions.DEFAULT_ACK_WAIT;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/io/nats/streaming/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ public interface Subscription extends AutoCloseable {
* @see io.nats.streaming.SubscriptionOptions
*/
SubscriptionOptions getOptions();

/**
* @return the inbox used by this subscription for acks.
*/
String getAckInbox();
}

2 changes: 1 addition & 1 deletion src/main/java/io/nats/streaming/SubscriptionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void wUnlock() {
rwlock.writeLock().unlock();
}

String getAckInbox() {
public String getAckInbox() {
return this.ackInbox;
}

Expand Down

0 comments on commit 72f964e

Please # to comment.