Changelog
0.3.2 - 2026-07-21
Fixes
- Skip tests if NATS server is unavailable.
0.3.1 - 2026-07-21
Added JetStream protocol support. Added auto-reconnect feature.
Added
- Added
hpublishand itspublish_with_headersalias for NATSHPUB. - Added
HMSGdelivery support. Received messages expose the raw header block throughheadersand its byte length throughheader_length. - Added header capability tracking from the server
INFOmessage. - Added
Net::NATS2::JetStreamwith account info, stream create/update/info, list, purge, delete, and synchronous publish acknowledgements. - Added durable pull-consumer creation, batch fetches, next-message retrieval,
and
ACK,NAK, andTERMmessage replies. - Added opt-in automatic reconnection with configurable attempts and delay; existing subscriptions are restored after reconnecting.
Fixed
- Advertise header support in
CONNECTand avoid sendingHPUBwhen the server reports that headers are unavailable. - Calculate
PUBandHPUBpayload lengths in UTF-8 bytes and encode UTF-8-flagged outbound protocol data before writing it to the socket. - Send the current
tls_requiredCONNECT option rather than the legacyssl_requiredoption. - Restore
nats://URI host, port, user, and password accessors with current versions of theURImodule. - Added
Client->request_syncfor request/reply APIs that need a single synchronous response, including JetStream.
0.3.0
This is a maintained fork of Carwyn Moore's Net::NATS::Client 0.2.2.
Breaking changes
- Renamed the distribution from
Net-NATS-ClienttoNet-NATS2-Client. - Renamed the public module namespace from
Net::NATS::*toNet::NATS2::*. - Replaced the public
URI::natsscheme adapter with the internalNet::NATS2::URIclass. Construct clients withNet::NATS2::Client.
Changed
- Removed the
Class::XSAccessordependency. All constructors, accessors, lvalue accessors, and the subscription defined predicate are now implemented in pure Perl. - Declared Perl 5.10.1 as the minimum supported Perl version.
- Updated examples, tests, POD, README, distribution metadata, and upstream attribution for the new namespace.
- Moved the full MIT licence text to
LICENSE, retaining both the upstream and fork copyright notices. - Made
Subscription->auto_unsubscribeandSubscription->unsubscribefluent by returning the subscription object.
Fixed
- Avoided direct
sysreadandsubstrmutation of the connection buffer accessor, preventing therealloc(): invalid pointerabort seen during socket reads.
Added
- Added tests. Tests require Docker Compose.
- Added
Net::NATS2::Client->ping($timeout)for explicit connection liveness checks. It sendsPING, waits forPONG, and continues dispatching normal protocol operations while it waits. - Added regression coverage for pure-Perl accessors, NATS URI parsing, publish/subscribe behavior, and PING/PONG liveness checks.