Releases: nats-io/nats.rb
Release v0.11.0
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 tonats-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
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://[email protected]:4222") NATS.connect("nats://[email protected]:4222")
Deprecated
- Removed Ruby 2.2 from build since no longer supported
Release v0.9.2
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
Release v0.8.4
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
- nats-top script not distributed with the gem now
(use Go version at https://github.com/nats-io/nats-top )