@hierotech/amqp-client
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@hierotech/amqp-client", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "AMQP client wrapper", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -27,6 +27,6 @@ const amqplib = require('amqplib'); | ||
* @param {object} config.exchange Exchanges configuration | ||
* @param {object} config.exchange.consume Consume exchange configuration | ||
* @param {object|null} config.exchange.consume Consume exchange configuration | ||
* @param {string} config.exchange.consume.name Consume exchange name | ||
* @param {string} [config.exchange.consume.type=fanout] Consume exchange type | ||
* @param {object} config.exchange.publish Publish exchange configuration | ||
* @param {object|null} config.exchange.publish Publish exchange configuration | ||
* @param {string} config.exchange.publish.name Publish exchange name | ||
@@ -152,2 +152,8 @@ * @param {string} [config.exchange.publish.type=fanout] Publish exchange type | ||
async _initConsume(connection) { | ||
const config = this._config.exchange.consume; | ||
if (!config) { | ||
return null; | ||
} | ||
const channel = await connection.createChannel(); | ||
@@ -157,3 +163,3 @@ | ||
const {name, type} = this._config.exchange.consume; | ||
const {name, type} = config; | ||
@@ -170,5 +176,11 @@ await channel.assertExchange(name, type); | ||
async _initPublish(connection) { | ||
const config = this._config.exchange.publish; | ||
if (!config) { | ||
return null; | ||
} | ||
const channel = await connection.createChannel(); | ||
const {name, type} = this._config.exchange.publish; | ||
const {name, type} = config; | ||
@@ -175,0 +187,0 @@ await channel.assertExchange(name, type); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7155
196