- Remove
buffer-more-intsdependency; use Node.js built-in BigInt Buffer methods (readBigInt64BE,readBigUInt64BE,writeBigInt64BE,writeBigUInt64BE) which have been available since Node.js v10.4
- BREAKING:
heartbeat: 0now disables heartbeats, overriding any value suggested by the server. Previously,0was treated as "no preference" and the server's suggested value was used. If you are passingheartbeat: 0and want to preserve the old behaviour, omit the option or passnullinstead (fixes #467)
- Add bundled TypeScript type definitions (fixes #843)
- Forward
handler-errorevents from the underlying connection to the recovery wrapper, so listeners attached toRecoveringPromiseModel/RecoveringCallbackModelreceive handler errors
- Add connection recovery via
connectWithRecoveryPromiseandconnectWithRecoveryCallback— automatically reconnects on connection loss with configurable backoff delay, jitter, and retry limits (thanks @ShiriNmi1520)
- Fix
update-secret-okevent not being forwarded byChannelModelandCallbackModel(fixes #849) - Add
handler-errorevent to connections and channels. If a user-supplied event handler (e.g.connection.on('close', ...),channel.on('error', ...),channel.on('delivery', ...)etc.) throws a synchronous error, amqplib will emit ahandler-errorevent on the same emitter with the thrown error and the name of the event whose handler threw — provided ahandler-errorlistener is registered. If nohandler-errorlistener is registered, behaviour is unchanged from previous versions. Note: in previous versions, errors thrown in connectioncloseevent handlers were silently swallowed; errors thrown in channel event handlers (other thandelivery/return) would kill the channel and possibly the connection (fixes #334).
- Fix channel.get() not invoking callback with error on channel close; previously only an error event was emitted (fixes #832). Note: if you use the callback API, ensure your channel.get() callbacks handle errors — they will now be invoked in error cases where previously they were not. If you use the promise API, the returned promise now rejects with a proper Error object (with .code, .classId and .methodId properties) rather than a raw close frame.
- Fix ConfirmChannel callbacks silently dropped on channel close when some publishes had no callback (fixes #191)
- Updated build to use RabbitMQ 4.2
- Fix memory leak in ConfirmChannel.publish when channel is already closed (fixes #842)
- Close connection immediately when close() is called while the connection is blocked (fixes #744)
- Fix AssertionError crash when backpressure occurs while draining newStreams in Mux (fixes #841)
- Replace url-parse with WHATWG URL API
- Fix TLS connection failure when connecting to an AMQPS broker using an IP address (IPv4 or IPv6) — setting servername to an IP is not permitted by TLS SNI and throws ERR_INVALID_ARG_VALUE in Node.js 25+
- BREAKING: Update minimum Node.js requirement to v18
- Introduce Biome formatter for consistent code formatting
- Add automated formatting via pre-commit hooks using Lefthook
- Format entire codebase with standardised formatting rules
- Add npm format script for manual code formatting
- Enable noUnusedFunctionParameters lint rule and fix all violations
- Enable noUnusedVariables lint rule and remove all unused variables from codebase
- Replace all var declarations with let/const for modern JavaScript standards
- Ensure parseInt calls use explicit radix parameter for clarity and reliability
- Fix precision loss in test data generators by using JavaScript safe integer limits
- Add block scoping to switch statement cases to prevent variable declaration issues
- Enforce const usage for variables that are never reassigned
- Add node: protocol prefix to Node.js builtin module imports for clarity
- Use modern exponentiation operator (**) instead of Math.pow()
- Replace string concatenation with modern template literals
- Remove redundant 'use strict' directives as modules are automatically in strict mode
- Refactor assignment-in-expression patterns to improve code clarity and readability
- Replace comma operators with individual statements for clearer, more readable code
- Split comma-separated variable declarations into individual statements for consistency
- Replace Object.prototype.hasOwnProperty() with safer Object.hasOwn() method
- Enforce strict equality checks (=== and !==) instead of loose equality (== and !=)
- Replace global isNaN with Number.isNaN for safer type checking
- Ensure no variable redeclarations exist to prevent shadowing issues
- Replace global isFinite with Number.isFinite for safer numeric validation
- Enable useArrowFunction lint rule to prefer arrow functions for cleaner syntax
- Enable noUselessCatch lint rule to prevent useless catch blocks that only rethrow errors
- Enable noArguments rule to enforce modern rest parameters instead of legacy arguments object
- Enable bracketSpacing formatting rule to add spaces inside object literals
- Migrate test suite from Mocha to Node.js built-in test runner
- Add support for IPv6 urls
- Updated README
- Remove bitsyntax dependency - See #785. Thanks @ikenfin
- Stop checking if frame max is exceeded when parsing frames - See #784. Thanks @ohroy
- Replace references to the old squaremo/amqp.name repo with ones to amqp-node/amqplib
- Use a frame_max of 131072 by default for RabbitMQ 4.1.0 compatibility
git log v0.10.4..v0.10.5
- Removed readable stream - See #729
- Added support for unsigned integers - See #773
- Committed protocol definitions - See https://github.com/amqp-node/amqplib/commit/0a87ee480311633cff41e43350a90cb3c1221506
- Improve stream example as per #722
- Added support for RabbitMQ's connection update-secret operation. See #755
git log v0.10.2..v0.10.3
- Use @acuminous/bitsyntax fork. See #453
git log v0.10.1..v0.10.2
- Use Buffer.allocUnsafe when sending messages to improve performance (PR 695, thank you @chkimes and @Uzlopak)
git log v0.10.0..v0.10.1
- Allow servername to be specified via socket options as discussed in issue 697
git log v0.9.1..v0.10.0
- Use Native promises (PR 689, thank you @mohd-akram and @kibertoad)
git log v0.9.0..v0.9.1
- Assorted readme changes
- Use Array.prototype.push.apply instead of concat in Mux (PR 658, thank you @Uzlopak and @kibertoad)
- Use Map instead of Object for BaseChannel.consumers (PR 660, thank you @Uzlopak)
- Delete consumer callback after cancellation to free memory (PR 659, thank you @Uzlopak and @kibertoad)
git log v0.8.0..v0.9.0
- Update mocha and replace the deprecated istanbul with nyc (PR 681
- Update url-parse (PR 675, thank you @suhail-n and @kibertoad)
- fix: done called twice on invalid options (PR 667, thank you @luddd3 and @kibertoad)
- Close connection to server on connect errors (PR 647, thank you @luddd3 and @kibertoad)
- Modernise channel_model.js (PR 635, thank you @kibertoad and @jimmywarting)
- Bring package-lock.json up to date (PR 653
- Update url-parse (PR 652, thank you @giorgioatanasov and @buffolander)
- Modernise channel_model.js (PR 651, thank you for the review @kibertoad)
- Modernise bitset.js (PR 634, thank you @kibertoad and @jimmywarting)
⚠️ Drop CI for node versions below 10 (PR 631, thank you for the review @kibertoad)- Replace safe-buffer dependency with native buffers (PR 628, thank you @kibertoad and @jimmywarting)
git log v0.7.1..v0.8.0
⚠️ Support for NodeJS prior to v10 is dropped⚠️ (PR 615, thank you @xamgore and everyone who helped there)- Use hostname as TLS servername, to help with using servers behind load balancers (PR 567, thanks to @carlhoerberg and commenters)
git log v0.7.0..v0.7.1
- Update url-parse (and others) (PR 607, thanks @ThomasGawlitza)
git log v0.6.0..v0.7.0
- Extend support to Node.js v15
- Fix use of stream.write in tests
git log v0.5.6..v0.6.0
- Extend support to Node.js v14
git log v0.5.5..v0.5.6
- Increase size of encoding space for message headers, to fit e.g., JWT (PR 545); thanks @twatson83
- Switch to a non-deprecated UUID module (PR 528); thanks to @StrayBird-ATSH
- Fix a bug in multiplexing that caused an assertion to fail (PR 503); thanks @johanneswuerbach
git log v0.5.3..v0.5.5
NB this includes a minor but possibly breaking change: after PR 498, all confirmation promises still unresolved will be rejected when their associated channel is closed.
- Generate defs in
npm preparerather thannpm prepublishso that e.g., amqplib can be installed via git (part of PR 498) - Reject all pending confirmations when the channel is closed (PR 498); thanks @johanneswuerbach
- Update supported NodeJS versions in package.json (PR 525); thanks @tingwai
This release was mistakenly published without the generated file
./defs.js. It has been deprecated in favour of v0.5.5.
git log v0.5.2..v0.5.3
- Bump bitsyntax to remove some
Buffermisuse deprecation notices ([PR 480])(#480) - Test on node 11.1 ([PR 473])(#464); thanks @kibertoad
- Updated various dependencies
- Support queue mode during assertQueue ([PR 464])(#464); thanks @JoeTheFkingFrypan
- Expose serverProperties in the connection object ([PR 452])(#452); thanks @jfromaniello
- Test on Node 10 ([PR 454])(#454); thanks @kibertoad
- Support amqplain credentials ([PR 451])(#451); thanks @jfromaniello
- Decorate channel errors with methodId and classId ([PR 447])(#447); thanks @MitMaro
- Resolve issues caused by Node 10
readablechanges ([PR 442])(#442) - Bump uglify to 2.6.x and node to 9.1 due to nodejs/node#16781. ([PR 439])(#439)
- Updated README with more modern Buffer syntax (PR 438; thanks @ravshansbox
- Support overflow option to assert queue ([PR 436])(#436); thanks to @honestserpent
- Replace instances of keyword
await([PR 396])(#396), as discussed in issue 235 - Use 3rd party url for better decoding of username/password ([PR 395])(#395), as discussed in issue 385)
git log v0.5.1..v0.5.2
- Increase encoding buffer to accommodate large header values (PR 367)
- Bring code up to date with new Buffer interface (PR 350)
- Fix dangling connection problem (PR 340)
- Clear up URL credentials parsing (PR 330)
- Allow connection params to be suppied in object (PR 304)
- Support explicit numeric types in field tables (e.g., headers) (PR 389, from a suggestion in issue 358)
Thank you to all contributors, of PRs, issues and comments.
git log v0.5.0..v0.5.1
- Fix mistake in closeBecause (PR 298; thanks to @lholznagel and others who reported the issue, and to @nfantone for the rapid fix)
git log v0.4.2..v0.5.0
- Port to use bluebird rather than when.js (PR 295; thanks to @nfantone, and special mention to @myndzi for #158)
- Fixed a problem with using
channel.getin the callback model (PR 283; good catch, @shanksauce) - Added an example that uses generators (thanks @rudijs)
- Fixed a link in the comments relating to heartbeats (thanks @tapickell)
git log v0.4.1..v0.4.2
- Better documentation and examples
- Replace uses of ES6 keyword 'await'
git log v0.4.0..v0.4.1
- Tested in Node.JS 0.8 through 4.2 and 5.5
- Emit an error with the 'close' event if server-initiated
git log v0.3.2..v0.4.0
- Tested on Node.JS 0.8 through 4.0 (and intervening io.js releases)
- Change meaning of 'b' fields in tables to match RabbitMQ (and AMQP specification)
- Can now pass an object in place of connection URL (PR 159; thanks to @ben-page)
- Operator-initiated connection close no longer results in 'error' event (issue 110)
- Channel and Connection errors have now a
.codefield with the AMQP reply-code, which may help distinguish error cases (PR 150; thanks to @hippich) - Connection.close will resolve to an error if the connection is already closed (issue 181)
- Connection establishment will resolve with an error if the TCP-level connection or the handshake times out (PR 169; thanks to @zweifisch and @RoCat, who both submitted fixes)
- Add the
maxPriorityoption as an alias for the'x-max-priority'queue argument (PR 180; thanks to @ebardes)
git log v0.3.1..v0.3.2
- Make the engine specification more flexible to admit io.js releases
git log v0.3.0..v0.3.1
- Fail in the right way when a channel cannot be allocated issue 129
- Make
waitForConfirmswork properly in callback API PR 116
- Two new options while connecting: timeout and keep alive (thanks to @rexxars and @jcrugzz respectively)
git log v0.2.1..v0.3.0
- Allow additional client properties to be set for a connection Issue 98 and PR 80
- New method in channel API to wait for all unconfirmed messages Issue 89
- Now supports RabbitMQ's
EXTERNALauthentication plugin Issue 105
- Do tuning negotation properly PR 84
git log v0.1.3..v0.2.0
- Correctly deal with missing fields (issue 48)
- Added a callback-oriented API, parallel to the existing, promise-oriented API.
- The response to assertExchange now contains the exchange name, analagous to assertQueue (issue 49)
- The channel method
prefetchnow has a global flag, to be compatible with newer RabbitMQ.
git log v0.1.2..v0.1.3
- Add support in the API for using Basic.Reject rather than Basic.Nack, the latter of which is a RabbitMQ extension and not in older versions of RabbitMQ.
git log v0.1.1..v0.1.2
- Restore support for publishing zero-length messages
- Recognise authentication failures
- An option to set TCP_NODELAY on connection sockets
git log v0.1.0..v0.1.1
- Safer frame construction, no longer relies on allocating a large, fixed-size buffer and hoping it's big enough
- The ports of RabbitMQ tutorials now avoid a race between publishing and closing the connection
- Support for RabbitMQ's consumer priority extension
- Support for RabbitMQ's connnection.blocked extension
- Better write speed from batching frames for small messages
- Other minor efficiency gains in method encoding and decoding
- Channel and connection state errors (e.g., trying to write when closed) include a stack trace from when they moved to that state
- The
argumentstable, passed as an option to some methods, can include fields in its prototype chain - Provide the more accurately named
persistentas a near equivalent ofdeliveryMode
git log v0.0.2..v0.1.0
- Consumer callbacks are invoked with
nullif the consumer is cancelled (see RabbitMQ's consumer cancel notification) - In confirm channels, instead of
#publishand#sendToQueuereturning promises, they return a boolean as for normal channels, and take a Node.JS-stylefunction (err, ok)callback for the server ack or nack
- Overlapping channel and connection close frames are dealt with gracefully
- Exceptions thrown in consumer callbacks are raised as
'error'events - Zero-size messages are handled
- Avoid monkey-patching
Buffer, and eschewrequire('util')._extend
- Channels now behave like
Writablestreams with regard to#publishand#sendToQueue, returning a boolean from those methods and emitting'drain' - Connections now multiplex frames from channels fairly
- Low-level channel machinery is now fully callback-based