amqp-connection-manager
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -0,1 +1,8 @@ | ||
# [2.1.0](https://github.com/benbria/node-amqp-connection-manager/compare/v2.0.0...v2.1.0) (2018-08-09) | ||
### Features | ||
* Support for per URL connection options ([ec2d484](https://github.com/benbria/node-amqp-connection-manager/commit/ec2d484)), closes [#29](https://github.com/benbria/node-amqp-connection-manager/issues/29) [#34](https://github.com/benbria/node-amqp-connection-manager/issues/34) [#44](https://github.com/benbria/node-amqp-connection-manager/issues/44) | ||
<a name="2.0.0"></a> | ||
@@ -14,16 +21,13 @@ # [2.0.0](https://github.com/benbria/node-amqp-connection-manager/compare/v1.4.2...v2.0.0) (2018-05-05) | ||
1.4.0 | ||
----- | ||
# 1.4.0 | ||
* Add 'blocked' and 'unblocked' events (#25). | ||
1.3.7 | ||
----- | ||
# 1.3.7 | ||
* Fix bug where we would stop sending messages if remote gracefully closes connection. | ||
1.3.6 | ||
----- | ||
# 1.3.6 | ||
* Fix bug where ChannelWrapper would expect setup function to return a Promise | ||
and not accept a callback if channel was already connected. |
@@ -48,3 +48,6 @@ 'use strict'; | ||
* | ||
* @param {string[]} urls - An array of brokers to connect to. | ||
* @param {(string|Object)[]} urls - An array of brokers to connect to. | ||
* Takes url strings or objects {url: string, connectionOptions?: object} | ||
* If present, a broker's [connectionOptions] will be used instead | ||
* of [options.connectionOptions] when passed to the amqplib connect method. | ||
* AmqplibConnectionManager will round-robin between them whenever it | ||
@@ -146,3 +149,7 @@ * needs to create a new connection. | ||
const amqpUrl = _url2.default.parse(url); | ||
// url can be a string or object {url: string, connectionOptions?: object} | ||
const urlString = url.url || url; | ||
const connectionOptions = url.connectionOptions || this.connectionOptions; | ||
const amqpUrl = _url2.default.parse(urlString); | ||
if (amqpUrl.search) { | ||
@@ -154,3 +161,3 @@ amqpUrl.search += `&heartbeat=${this.heartbeatIntervalInSeconds}`; | ||
return _amqplib2.default.connect(_url2.default.format(amqpUrl), this.connectionOptions).then(connection => { | ||
return _amqplib2.default.connect(_url2.default.format(amqpUrl), connectionOptions).then(connection => { | ||
this._currentConnection = connection; | ||
@@ -183,3 +190,3 @@ | ||
this._connecting = false; | ||
this.emit('connect', { connection, url }); | ||
this.emit('connect', { connection, url: urlString }); | ||
@@ -186,0 +193,0 @@ return null; |
{ | ||
"name": "amqp-connection-manager", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Auto-reconnect and round robin support for amqplib.", | ||
@@ -13,9 +13,10 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@semantic-release/changelog": "^2.0.2", | ||
"@semantic-release/git": "^4.0.3", | ||
"@jwalton/semantic-release-config": "^1.0.0", | ||
"@semantic-release/changelog": "^3.0.0", | ||
"@semantic-release/git": "^7.0.1", | ||
"amqplib": "^0.5.1", | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.3", | ||
"babel-env": "^2.4.1", | ||
"babel-plugin-istanbul": "^4.1.6", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-register": "^6.26.0", | ||
@@ -25,5 +26,4 @@ "chai": "^4.1.2", | ||
"chai-string": "^1.1.2", | ||
"commitlint": "^6.2.0", | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.19.1", | ||
"eslint": "^5.0.0", | ||
"eslint-config-benbria": "^3.0.2", | ||
@@ -36,7 +36,7 @@ "eslint-plugin-import": "^2.11.0", | ||
"mocha": "^5.1.1", | ||
"nyc": "^11.7.1", | ||
"nyc": "^12.0.1", | ||
"promise-tools": "^1.1.0", | ||
"proxyquire": "^2.0.1", | ||
"semantic-release": "^15.2.0", | ||
"sinon": "^5.0.1" | ||
"semantic-release": "^15.9.6", | ||
"sinon": "^6.0.1" | ||
}, | ||
@@ -55,3 +55,3 @@ "engines": { | ||
"test:lint": "eslint src test", | ||
"precommit:unittest": "NODE_ENV=test nyc mocha test --reporter progress", | ||
"precommit:unittest": "BABEL_DISABLE_CACHE=1 NODE_ENV=test nyc mocha test --reporter progress", | ||
"semantic-release": "semantic-release" | ||
@@ -61,3 +61,2 @@ }, | ||
"hooks": { | ||
"commit-msg": "commitlint -e $GIT_PARAMS", | ||
"pre-commit": "npm run test:lint && npm run precommit:unittest" | ||
@@ -64,0 +63,0 @@ } |
@@ -79,3 +79,3 @@ [![Build Status](https://travis-ci.org/benbria/node-amqp-connection-manager.svg?branch=master)](https://travis-ci.org/benbria/node-amqp-connection-manager) | ||
channelWrapper.addSetup(function(channel) { | ||
Promise.all([ | ||
return Promise.all([ | ||
channel.assertQueue("my-queue", { exclusive: true, autoDelete: true }), | ||
@@ -147,3 +147,3 @@ channel.bindQueue("my-queue", "my-exchange", "create"), | ||
`setup(channel, [cb])` is a function to call when a new underlying channel is created - handy for asserting | ||
exchanges and queues exists, and whatnot. The `channel` object here is a ConfigChannel from amqplib. | ||
exchanges and queues exists, and whatnot. The `channel` object here is a ConfirmChannel from amqplib. | ||
The `setup` function should return a Promise (or optionally take a callback) - no messages will be sent until | ||
@@ -150,0 +150,0 @@ this Promise resolves. |
module.exports = { | ||
"extends": "@jwalton/semantic-release-config", | ||
"verifyConditions": [ | ||
@@ -12,2 +13,2 @@ "@semantic-release/changelog", | ||
] | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
526
0
115528