Skip to content

Release v3.4.0

Compare
Choose a tag to compare
@kozlovic kozlovic released this 23 Sep 18:26
· 158 commits to main since this release
a1ce12b

Changelog

Added

  • JetStream:
    • Stream RePublish configuration (#546, #563)
    • jsConsumerConfig has now Replicas and MemoryStorage fields that can be used to changed the value that is normally inherited from the stream (#546)
    • jsPubAckHandler to handle "positive" asynchronous publish acknowledgments. Thanks to @pramodsri for the suggestion (#538)
    • AllowDirect stream configuration that then allows the use of a new js_DirectGetMsg API to be able to retrieve a message from a distributed queue group of servers (leader+replicas) (#562, #571, #576, #577, #579)
    • Support for ephemeral pull subscriptions, by omitting the durable name in the js_PullSubscribe() call (#578)
    • Name in jsConsumerConfig structure. Users can now select consumer names, even for ephemerals. When Name is specified, the creation of the consumer will be sent to a $JS.API subject that is new to server v2.9.0 and allows for the stream and consumer name (and possibly filter subject) to be part of the subject and can be protected with permissions (#580)
    • natsSubscription_FetchRequest() which allows the user to fully configure a pull subscription fetch request (#584)
    • js_Streams() and js_StreamNames() to respectively get the list of stream informations (jsStreamInfo) and the stream names. The optional subject filter can be provided to limit to streams matching this filter (#591)
    • js_Consumers() and js_ConsumerNames() to respectively get the list of consumer informations (jsConsumerInfo) and the consumer names for a given stream (#592)
    • DiscardNewPerSubject in jsStreamConfig structure. This requires server v2.9.1+ (#593)
  • KeyValue:
    • RePublish configuration (#570)
  • natsOptions_SetIgnoreDiscoveredServers to ignore gossiped server URLs. The library will be able to reconnect only to the user-given list of servers (#552)
  • natsSubscription_GetID and natsSubscription_GetSubject. Thanks to @hided for the contribution (#565)

Changed

  • Build:
    • Changed const int to int for Count field in various lists since this was causing some build issues with C++ and the use of const was not really helping preventing issues. Thanks to @simontherry and @Kazmirchuk for the report/suggestion (#567)
  • JetStream:
    • Users can now use MaxWait from the jsPubOptions to cause an asynchronous published message to timeout and invoke either the existing jsPubAckErrHandler or new jsPubAckHandler (#538)
    • Durable/Consumer names check to reject ., , * and > since could cause issues since names may be part of the $JS.API subject requests are sent on (#585)
    • Pull consumer can now user AckNone and AckAll. The restriction at the library level has been lifted since NATS Server v2.9.0+ accepts them now (#587)
    • js_GetStreamInfo(), when a subject filter is specified, will now return all subjects for this stream, and not be limited to the 100,000 limit that the server had prior to v2.9.0 (#588)
  • KeyValue:
    • KeyValue store backed streams will now be created with the AllowDirect boolean. If a KeyValue's stream has this property, the kvStore_Get API will use the js_DirectGetMsg API instead of js_GetMsg (#562)
  • Count message headers towards subscription limits (#583)

Improved

  • Suppress unneeded UNSUB protocol on subscription destroy when delivered messages reached the auto-unsubscribe value. Thanks to @Kazmirchuk for the report (#560)

Updated

  • JetStream:
    • Consumer configuration check that is made when calling js_Subscribe (or the like) and verifying that the existing consumer's configuration matches the one provided by the user (#564)
    • jsAccountInfo, jsAccountLimits and a new jsTier structure to account for tier limits in the account (#586)

Fixed

  • Build:
    • Failure to build on armel due to use of yield. Thanks to @linuxmaniac for the contribution (#556)
    • Compiler warning for internal nats_JSONGetTime function (#557)
  • JetStream:
    • Stream and consumer name checks: APIs need to reject names that contain a . (#537)
    • natsSubscription_Destroy should not have destroyed JetStream consumers if they were created by the library. This was supposed to be done only on explicit natsSubscription_Unsubscribe() or natsSubscription_Drain() (or connection drain) (#582)
  • KeyValue:
    • Set watcher internal subscription limits to "unlimited" to prevent "slow consumer" errors that would cause messages to be dropped (#559)
  • Handling of JSON's empty arrays (#590)

Complete Changes

v3.3.0...v3.4.0