Skip to content

Release v0.7.0

Compare
Choose a tag to compare
@wallyqs wallyqs released this 17 Aug 02:23
· 231 commits to main since this release
935874e

This implements support for headers that got introduced in NATS v2.2.

Added

  • Added publish_msg and request_msg that can be used to dispatch a NATS::Msg type
      msg = NATS::Msg.new(subject: 'hello', data: data, header: {'foo': 'bar'})
      resp = nc.request_msg(msg, timeout: 1)

Currently to receive headers a callback requires the correct following arity:

    nc.subscribe("hello") do |data, reply, subject, header|
      puts header
    end
  • Added support for no responders.

In case of making a request with no responders then a NATS::IO::NoRespondersError is now yield by default.

No responders feature can be disabled by using no_responders: false option on connect

    nc = NATS::IO::Client.new
    nc.connect(servers: [@s.uri], no_responders: false)
  • Added old_style option for when making a request, for example:
    pull_req = { no_wait: true, batch: 1}
    resp = nc.request("$JS.API.CONSUMER.MSG.NEXT.foojs.sample", pull_req.to_json, old_style: true)

Fixed

  • Fixed leak of futures when a request times out #47