@midwayjs/mqtt 3.14.12 → 3.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/configuration.d.ts +3 -0
- package/dist/configuration.js +4 -1
- package/dist/framework.d.ts +2 -0
- package/dist/framework.js +33 -26
- package/dist/interface.d.ts +8 -2
- package/dist/service.d.ts +5 -5
- package/dist/service.js +14 -18
- package/package.json +4 -4
- package/dist/mq.d.ts +0 -24
- package/dist/mq.js +0 -112
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 - Now midwayjs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/configuration.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { IMidwayContainer } from '@midwayjs/core';
|
|
2
2
|
import { MidwayMQTTFramework } from './framework';
|
|
3
|
+
import { MqttProducerFactory } from './service';
|
|
3
4
|
export declare class MQTTConfiguration {
|
|
4
5
|
framework: MidwayMQTTFramework;
|
|
6
|
+
factory: MqttProducerFactory;
|
|
5
7
|
onReady(container: IMidwayContainer): Promise<void>;
|
|
8
|
+
onStop(): Promise<void>;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=configuration.d.ts.map
|
package/dist/configuration.js
CHANGED
|
@@ -15,7 +15,10 @@ const framework_1 = require("./framework");
|
|
|
15
15
|
const service_1 = require("./service");
|
|
16
16
|
let MQTTConfiguration = class MQTTConfiguration {
|
|
17
17
|
async onReady(container) {
|
|
18
|
-
await container.getAsync(service_1.MqttProducerFactory);
|
|
18
|
+
this.factory = await container.getAsync(service_1.MqttProducerFactory);
|
|
19
|
+
}
|
|
20
|
+
async onStop() {
|
|
21
|
+
await this.factory.stop();
|
|
19
22
|
}
|
|
20
23
|
};
|
|
21
24
|
__decorate([
|
package/dist/framework.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export declare class MidwayMQTTFramework extends BaseFramework<IMidwayMQTTApplic
|
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
protected beforeStop(): Promise<void>;
|
|
12
12
|
createSubscriber(connectionOptions: IClientOptions, clientName?: string): Promise<MqttClient>;
|
|
13
|
+
getSubscriber(name: string): MqttClient;
|
|
14
|
+
getSubscribers(): MqttClient[];
|
|
13
15
|
getFrameworkName(): string;
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=framework.d.ts.map
|
package/dist/framework.js
CHANGED
|
@@ -22,6 +22,9 @@ let MidwayMQTTFramework = class MidwayMQTTFramework extends core_1.BaseFramework
|
|
|
22
22
|
return this.configService.getConfiguration('mqtt');
|
|
23
23
|
}
|
|
24
24
|
async applicationInitialize(options) {
|
|
25
|
+
this.app = {};
|
|
26
|
+
}
|
|
27
|
+
async run() {
|
|
25
28
|
const { sub } = this.configurationOptions;
|
|
26
29
|
if (Object.keys(sub || {}).length === 0) {
|
|
27
30
|
this.mqttLogger.info('[midway-mqtt] Not found consumer config, skip init consumer');
|
|
@@ -34,29 +37,22 @@ let MidwayMQTTFramework = class MidwayMQTTFramework extends core_1.BaseFramework
|
|
|
34
37
|
mqttSubscriberMap[subscriberName] = subscriberModule;
|
|
35
38
|
}
|
|
36
39
|
for (const customKey in sub) {
|
|
37
|
-
const consumer = await this.createSubscriber(sub[customKey].connectOptions);
|
|
38
|
-
consumer.
|
|
40
|
+
const consumer = await this.createSubscriber(sub[customKey].connectOptions, customKey);
|
|
41
|
+
await consumer.subscribeAsync(sub[customKey].subscribeOptions.topicObject, sub[customKey].subscribeOptions.opts);
|
|
42
|
+
consumer.on('message', async (topic, message, packet) => {
|
|
39
43
|
const ctx = this.app.createAnonymousContext();
|
|
40
|
-
ctx.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const instance = await ctx.requestContext.getAsync(mqttSubscriberMap[customKey]);
|
|
50
|
-
// eslint-disable-next-line prefer-spread
|
|
51
|
-
return await instance['subscribe'].call(instance, ctx);
|
|
52
|
-
});
|
|
53
|
-
return await fn(ctx);
|
|
54
|
-
}
|
|
44
|
+
ctx.topic = topic;
|
|
45
|
+
ctx.packet = packet;
|
|
46
|
+
ctx.message = message;
|
|
47
|
+
const fn = await this.applyMiddleware(async (ctx) => {
|
|
48
|
+
const instance = await ctx.requestContext.getAsync(mqttSubscriberMap[customKey]);
|
|
49
|
+
// eslint-disable-next-line prefer-spread
|
|
50
|
+
return await instance['subscribe'].call(instance, ctx);
|
|
51
|
+
});
|
|
52
|
+
return await fn(ctx);
|
|
55
53
|
});
|
|
56
54
|
}
|
|
57
|
-
this.app = {};
|
|
58
55
|
}
|
|
59
|
-
async run() { }
|
|
60
56
|
async beforeStop() {
|
|
61
57
|
for (const [name, consumer] of this.subscriberMap) {
|
|
62
58
|
await consumer.endAsync();
|
|
@@ -64,14 +60,25 @@ let MidwayMQTTFramework = class MidwayMQTTFramework extends core_1.BaseFramework
|
|
|
64
60
|
}
|
|
65
61
|
}
|
|
66
62
|
async createSubscriber(connectionOptions, clientName) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
return new Promise(resolve => {
|
|
64
|
+
const client = (0, mqtt_1.connect)(connectionOptions);
|
|
65
|
+
client.on('connect', () => {
|
|
66
|
+
if (clientName) {
|
|
67
|
+
this.logger.info('[midway-mqtt] subscriber: %s is connect', clientName);
|
|
68
|
+
this.subscriberMap.set(clientName, client);
|
|
69
|
+
}
|
|
70
|
+
resolve(client);
|
|
71
|
+
});
|
|
72
|
+
client.on('error', err => {
|
|
73
|
+
this.mqttLogger.error(err);
|
|
74
|
+
});
|
|
70
75
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
}
|
|
77
|
+
getSubscriber(name) {
|
|
78
|
+
return this.subscriberMap.get(name);
|
|
79
|
+
}
|
|
80
|
+
getSubscribers() {
|
|
81
|
+
return Object.values(this.subscriberMap);
|
|
75
82
|
}
|
|
76
83
|
getFrameworkName() {
|
|
77
84
|
return 'midway:mqtt';
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import { IConfigurationOptions, IMidwayApplication, IMidwayContext, NextFunction as BaseNextFunction, ServiceFactoryConfigOption } from '@midwayjs/core';
|
|
2
|
-
import type { IClientOptions, IClientSubscribeOptions, IClientSubscribeProperties, ISubscriptionMap,
|
|
3
|
+
import type { IClientOptions, IClientSubscribeOptions, IClientSubscribeProperties, ISubscriptionMap, IPublishPacket } from 'mqtt';
|
|
3
4
|
export interface MqttSubscriberOptions {
|
|
4
5
|
topicObject: string | string[] | ISubscriptionMap;
|
|
5
6
|
opts?: IClientSubscribeOptions | IClientSubscribeProperties;
|
|
@@ -15,10 +16,15 @@ export interface IMidwayMQTTConfigurationOptions extends IConfigurationOptions {
|
|
|
15
16
|
pub: ServiceFactoryConfigOption<IClientOptions>;
|
|
16
17
|
}
|
|
17
18
|
export type IMidwayMQTTContext = IMidwayContext<{
|
|
18
|
-
|
|
19
|
+
topic: string;
|
|
20
|
+
message: Buffer;
|
|
21
|
+
packet: IPublishPacket;
|
|
19
22
|
}>;
|
|
20
23
|
export type Application = IMidwayMQTTApplication;
|
|
21
24
|
export interface Context extends IMidwayMQTTContext {
|
|
22
25
|
}
|
|
23
26
|
export type NextFunction = BaseNextFunction;
|
|
27
|
+
export interface IMqttSubscriber {
|
|
28
|
+
subscribe(ctx: IMidwayMQTTContext): Promise<void>;
|
|
29
|
+
}
|
|
24
30
|
//# sourceMappingURL=interface.d.ts.map
|
package/dist/service.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ServiceFactory } from '@midwayjs/core';
|
|
2
|
-
import { MqttClient } from 'mqtt';
|
|
1
|
+
import { ILogger, ServiceFactory, ServiceFactoryConfigOption } from '@midwayjs/core';
|
|
2
|
+
import { type IClientOptions, MqttClient } from 'mqtt';
|
|
3
3
|
export declare class MqttProducerFactory extends ServiceFactory<MqttClient> {
|
|
4
|
-
logger:
|
|
5
|
-
pubConfig:
|
|
4
|
+
logger: ILogger;
|
|
5
|
+
pubConfig: ServiceFactoryConfigOption<IClientOptions>;
|
|
6
6
|
getName(): string;
|
|
7
7
|
init(): Promise<void>;
|
|
8
8
|
protected createClient(config: any, clientName: any): Promise<MqttClient>;
|
|
9
|
-
destroyClient(producer:
|
|
9
|
+
destroyClient(producer: MqttClient, name: string): Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
export declare class DefaultMqttProducer implements MqttClient {
|
|
12
12
|
private mqttProducerFactory;
|
package/dist/service.js
CHANGED
|
@@ -11,9 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DefaultMqttProducer = exports.MqttProducerFactory = void 0;
|
|
13
13
|
const core_1 = require("@midwayjs/core");
|
|
14
|
-
const core_2 = require("@midwayjs/core");
|
|
15
14
|
const mqtt_1 = require("mqtt");
|
|
16
|
-
let MqttProducerFactory = class MqttProducerFactory extends
|
|
15
|
+
let MqttProducerFactory = class MqttProducerFactory extends core_1.ServiceFactory {
|
|
17
16
|
getName() {
|
|
18
17
|
return 'mqtt';
|
|
19
18
|
}
|
|
@@ -21,23 +20,20 @@ let MqttProducerFactory = class MqttProducerFactory extends core_2.ServiceFactor
|
|
|
21
20
|
await this.initClients(this.pubConfig);
|
|
22
21
|
}
|
|
23
22
|
async createClient(config, clientName) {
|
|
24
|
-
|
|
25
|
-
(0, mqtt_1.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
.catch(reject);
|
|
23
|
+
return new Promise(resolve => {
|
|
24
|
+
const client = (0, mqtt_1.connect)(config);
|
|
25
|
+
client.on('connect', () => {
|
|
26
|
+
this.logger.info('[midway-mqtt] producer: %s is connect', clientName);
|
|
27
|
+
resolve(client);
|
|
28
|
+
});
|
|
29
|
+
client.on('error', err => {
|
|
30
|
+
this.logger.error(err);
|
|
31
|
+
});
|
|
35
32
|
});
|
|
36
|
-
this.logger.info('[midway-mqtt] producer: %s is ready', clientName);
|
|
37
|
-
return producer;
|
|
38
33
|
}
|
|
39
|
-
async destroyClient(producer) {
|
|
34
|
+
async destroyClient(producer, name) {
|
|
40
35
|
await producer.endAsync();
|
|
36
|
+
this.logger.info('[midway-mqtt] producer: %s is close', name);
|
|
41
37
|
}
|
|
42
38
|
};
|
|
43
39
|
__decorate([
|
|
@@ -63,7 +59,7 @@ let DefaultMqttProducer = class DefaultMqttProducer {
|
|
|
63
59
|
async init() {
|
|
64
60
|
this.instance = this.mqttProducerFactory.get(this.mqttProducerFactory.getDefaultClientName() || 'default');
|
|
65
61
|
if (!this.instance) {
|
|
66
|
-
throw new
|
|
62
|
+
throw new core_1.MidwayCommonError('mqtt default producer instance not found.');
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
65
|
};
|
|
@@ -82,5 +78,5 @@ DefaultMqttProducer = __decorate([
|
|
|
82
78
|
(0, core_1.Scope)(core_1.ScopeEnum.Singleton)
|
|
83
79
|
], DefaultMqttProducer);
|
|
84
80
|
exports.DefaultMqttProducer = DefaultMqttProducer;
|
|
85
|
-
(0,
|
|
81
|
+
(0, core_1.delegateTargetAllPrototypeMethod)(DefaultMqttProducer, mqtt_1.MqttClient);
|
|
86
82
|
//# sourceMappingURL=service.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/mqtt",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.2",
|
|
4
4
|
"description": "Midway Framework for mqtt",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
],
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@midwayjs/
|
|
27
|
-
"@midwayjs/
|
|
26
|
+
"@midwayjs/core": "^3.15.0",
|
|
27
|
+
"@midwayjs/mock": "^3.15.2"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"mqtt": "5.3.5"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=16"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "e8b53689c50aa8c9a691de7d985cafd62f5f70e7"
|
|
41
41
|
}
|
package/dist/mq.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This RabbitMQ Server changed from https://github.com/JeniTurtle/egg-rabbitmq-plus/blob/master/rabbitmq.ts
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
import * as amqp from 'amqp-connection-manager';
|
|
6
|
-
import { IRabbitMQApplication } from './interface';
|
|
7
|
-
import { ConsumeMessage } from 'amqplib/properties';
|
|
8
|
-
import { RabbitMQListenerOptions, ILogger } from '@midwayjs/core';
|
|
9
|
-
import type { Channel } from 'amqplib';
|
|
10
|
-
import { EventEmitter } from 'events';
|
|
11
|
-
export declare class RabbitMQServer extends EventEmitter implements IRabbitMQApplication {
|
|
12
|
-
protected channelManagerSet: Set<Channel>;
|
|
13
|
-
protected connection: amqp.AmqpConnectionManager;
|
|
14
|
-
protected logger: ILogger;
|
|
15
|
-
protected reconnectTime: any;
|
|
16
|
-
constructor(options?: any);
|
|
17
|
-
bindError(): void;
|
|
18
|
-
createChannel(isConfirmChannel?: boolean): Promise<any>;
|
|
19
|
-
connect(url: any, socketOptions: any): Promise<void>;
|
|
20
|
-
createConsumer(listenerOptions: RabbitMQListenerOptions, listenerCallback: (msg: ConsumeMessage | null, channel: Channel, channelWrapper: any) => Promise<void>): Promise<void>;
|
|
21
|
-
protected closeConnection(): Promise<void>;
|
|
22
|
-
close(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=mq.d.ts.map
|
package/dist/mq.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* This RabbitMQ Server changed from https://github.com/JeniTurtle/egg-rabbitmq-plus/blob/master/rabbitmq.ts
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RabbitMQServer = void 0;
|
|
7
|
-
const amqp = require("amqp-connection-manager");
|
|
8
|
-
const events_1 = require("events");
|
|
9
|
-
class RabbitMQServer extends events_1.EventEmitter {
|
|
10
|
-
constructor(options = {}) {
|
|
11
|
-
var _a;
|
|
12
|
-
super();
|
|
13
|
-
this.channelManagerSet = new Set();
|
|
14
|
-
this.connection = null;
|
|
15
|
-
this.logger = options.logger;
|
|
16
|
-
this.reconnectTime = (_a = options.reconnectTime) !== null && _a !== void 0 ? _a : 10 * 1000;
|
|
17
|
-
this.bindError();
|
|
18
|
-
}
|
|
19
|
-
bindError() {
|
|
20
|
-
this.on('error', err => {
|
|
21
|
-
this.logger.error(err);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
createChannel(isConfirmChannel = false) {
|
|
25
|
-
if (!isConfirmChannel) {
|
|
26
|
-
return this.connection.connection.createChannel();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return this.connection.connection.createConfirmChannel();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
async connect(url, socketOptions) {
|
|
33
|
-
this.connection = await amqp.connect(url, socketOptions);
|
|
34
|
-
// 监听在设置创建 channel 的错误
|
|
35
|
-
this.connection.on('error', err => {
|
|
36
|
-
if (err) {
|
|
37
|
-
if (err.err) {
|
|
38
|
-
err = err.err;
|
|
39
|
-
}
|
|
40
|
-
this.logger.error('Message Queue error', err);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this.logger.info('Message Queue disconnected!');
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
await new Promise((resolve, reject) => {
|
|
47
|
-
// 监听 成功连接 的通知
|
|
48
|
-
this.connection.on('connect', () => {
|
|
49
|
-
this.logger.info('Message Queue connected!');
|
|
50
|
-
resolve();
|
|
51
|
-
});
|
|
52
|
-
// 监听 连接失败的错误 通知
|
|
53
|
-
this.connection.on('connectFailed', err => {
|
|
54
|
-
if (err) {
|
|
55
|
-
if (err.err) {
|
|
56
|
-
err = err.err;
|
|
57
|
-
}
|
|
58
|
-
this.logger.error('Message Queue disconnected', err);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
this.logger.info('Message Queue disconnected!');
|
|
62
|
-
}
|
|
63
|
-
reject(err);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
async createConsumer(listenerOptions, listenerCallback) {
|
|
68
|
-
const channelWrapper = this.connection.createChannel({
|
|
69
|
-
setup: (channel) => {
|
|
70
|
-
var _a, _b, _c;
|
|
71
|
-
// `channel` here is a regular amqplib `ConfirmChannel`.
|
|
72
|
-
const channelHandlers = [];
|
|
73
|
-
// create queue
|
|
74
|
-
channelHandlers.push(channel.assertQueue(listenerOptions.queueName, Object.assign({ durable: true }, listenerOptions)));
|
|
75
|
-
if (listenerOptions.exchange) {
|
|
76
|
-
// create exchange
|
|
77
|
-
channelHandlers.push(channel.assertExchange(listenerOptions.exchange, (_b = (_a = listenerOptions.exchangeOptions) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : 'topic', listenerOptions.exchangeOptions));
|
|
78
|
-
// bind exchange and queue
|
|
79
|
-
channelHandlers.push(channel.bindQueue(listenerOptions.queueName, listenerOptions.exchange, listenerOptions.routingKey || listenerOptions.pattern, listenerOptions.exchangeOptions));
|
|
80
|
-
}
|
|
81
|
-
channelHandlers.push(channel.prefetch((_c = listenerOptions.prefetch) !== null && _c !== void 0 ? _c : 1));
|
|
82
|
-
// listen queue
|
|
83
|
-
channelHandlers.push(channel.consume(listenerOptions.queueName, async (msg) => {
|
|
84
|
-
await listenerCallback(msg, channel, channelWrapper);
|
|
85
|
-
}, listenerOptions.consumeOptions));
|
|
86
|
-
return Promise.all(channelHandlers);
|
|
87
|
-
},
|
|
88
|
-
json: true,
|
|
89
|
-
});
|
|
90
|
-
return channelWrapper.waitForConnect();
|
|
91
|
-
}
|
|
92
|
-
async closeConnection() {
|
|
93
|
-
try {
|
|
94
|
-
if (this.connection) {
|
|
95
|
-
await this.connection.close();
|
|
96
|
-
}
|
|
97
|
-
this.logger.debug('Message Queue connection close success');
|
|
98
|
-
}
|
|
99
|
-
catch (err) {
|
|
100
|
-
this.logger.error('Message Queue connection close error', err);
|
|
101
|
-
}
|
|
102
|
-
finally {
|
|
103
|
-
this.connection = null;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async close() {
|
|
107
|
-
this.logger.debug('Message Queue will be close');
|
|
108
|
-
await this.closeConnection();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.RabbitMQServer = RabbitMQServer;
|
|
112
|
-
//# sourceMappingURL=mq.js.map
|