Skip to content

Releases: nats-io/nats.rb

Release v0.11.0

11 Jun 00:56
f91c4d6
Compare
Choose a tag to compare

Release with support for NATS v2 auth features

Added

  • Support for user credentials that contain a JWT/NKEY to auth against NATS v2 servers
require 'nats/client'

NATS.start("tls://connect.ngs.global", user_credentials: "/path/to/creds") do |nc|
  nc.subscribe("hello") do |msg|
    puts "[Received] #{msg}"
  end
  nc.publish('hello', 'world')
end
  • Support to authenticate against NATS v2 servers that use NKEYS
require 'nats/client'

NATS.start("tls://connect.ngs.global", nkeys_seed: "path/to/seed.txt") do |nc|
  nc.subscribe("hello") do |msg|
    puts "[Received] #{msg}"
  end
  nc.publish('hello', 'world')
end
  • Added --creds option to nats-pub, nats-sub, nats-queue tools

Changed

  • Internal changes to process initial INFO message from the server

Fixed

  • Fixed being able to use 'tls' as the scheme when connecting with a single URL

    NATS.connect("tls://demo.nats.io:4443")

Release v0.10.0

31 Aug 21:19
77d8a8e
Compare
Choose a tag to compare

Added

  • Support for drain mode (#157)

    This feature allows clients to gracefully disconect, letting the subscribers
    handle any inflight messages that may have been sent by the server already.

    NATS.start(drain_timeout: 1) do |nc|
      NATS.subscribe('foo', queue: "workers") do |msg, reply, sub|
        nc.publish(reply, "ACK:#{msg}")
      end
    
      NATS.subscribe('bar', queue: "workers") do |msg, reply, sub|
        nc.publish(reply, "ACK:#{msg}")
      end
    
      NATS.subscribe('quux', queue: "workers") do |msg, reply, sub|
        nc.publish(reply, "ACK:#{msg}")
      end
    
      EM.add_timer(2) do
        next if NATS.draining?
    
        # Drain gracefully closes the connection.
        NATS.drain do
          puts "Done draining. Connection is closed."
        end
      end
    end
  • Support for no_echo mode (#155)

    When connected to a NATS Server v1.2.0 or above, a client can now opt to avoid
    receiving messages that it itself has published.

    NATS.connect(no_echo: true)

Improved

  • NATS.connect API is now more similar to how it works in the Go client (#156):

    # Assume 'nats://' scheme
    NATS.connect("demo.nats.io:4222")
    
    # Complete with scheme a la Go client classic usage.
    NATS.connect("nats://demo.nats.io:4222")
    
    # Use default 4222 port.
    NATS.connect("demo.nats.io")
    
    # Explicit cluster list still supported
    NATS.connect(servers: ["nats://demo.nats.io:4222"])

Fixed

  • Client now supports token based authorization

    NATS.connect(token: "deadbeef")
    
    NATS.connect(uri: "nats://deadbeef@127.0.0.1:4222")
    
    NATS.connect("nats://deadbeef@127.0.0.1:4222")

Deprecated

Release v0.9.2

27 Jul 23:37
Compare
Choose a tag to compare

Minor version release including fixes to support multiple CAs when using secure connections.

Fixed

TLS Peer verification: ssl_verify_peer does not support multiple CAs

#151 Thanks to @h4xnoodle @pivotal-jamil-shamy for the contribution.

Release v0.9.0

27 Jun 21:44
Compare
Choose a tag to compare

Added

  • Support new style request/response using Fibers (#149)

Changed

  • Inboxes are now NUID based (8ced98d)

Release v0.8.4

23 Feb 17:43
746b65d
Compare
Choose a tag to compare

Added

  • Support to include connection name as part of CONNECT options (#145)

Fixed

  • Fixed support for Ruby 2.5 due to missing OpenSSL require (#144)

Removed

v0.8.2

14 Mar 15:16
Compare
Choose a tag to compare
  • Allow setting name from client on connect (#129)
  • Add discovered servers helper for servers announced via async INFO (#136)
  • Add time based reconnect backoff (#139)
  • Modify lang sent on connect when using jruby (#135)
  • Update eventmachine dependencies (#134)

v0.8.0

11 Aug 00:08
Compare
Choose a tag to compare
  • Added cluster auto discovery handling which is supported on v0.9.2 server release (#125)
  • Added jruby part of the build (both in openjdk and oraclejdk runtimes) (#122 #123)
  • Fixed ping interval accounting (#120)

v0.7.1

08 Jul 23:10
Compare
Choose a tag to compare

Minor release which changes nats client dependencies so that only Eventmachine > 1.2 is required

v0.7.0

08 Jul 18:46
Compare
Choose a tag to compare
  • Eventmachine bumped to 1.2 series
  • Upgraded TLS support, certs and verify peer functionality