@autofleet/rabbit 2.1.5 → 2.1.6
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/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/package.json +1 -1
- package/src/index.ts +5 -0
package/dist/index.d.ts
CHANGED
|
@@ -57,5 +57,6 @@ declare class RabbitMq implements IAfRabbitMq {
|
|
|
57
57
|
consumeFromExchange(queue: string, exchange: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any): Promise<void>;
|
|
58
58
|
publish(exchange: string, content: any, customHeaders?: any): Promise<unknown>;
|
|
59
59
|
sendToQueue(queue: string, content: any, options?: any, customHeaders?: any): Promise<void>;
|
|
60
|
+
isConnected(): Promise<boolean>;
|
|
60
61
|
}
|
|
61
62
|
export default RabbitMq;
|
package/dist/index.js
CHANGED
|
@@ -281,5 +281,11 @@ class RabbitMq {
|
|
|
281
281
|
return channel.sendToQueue(queue, Buffer.from(JSON.stringify(content)), RabbitMq.getPublishOptions(customHeaders));
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
|
+
isConnected() {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
const connection = yield this.getConnection();
|
|
287
|
+
return connection.isConnected();
|
|
288
|
+
});
|
|
289
|
+
}
|
|
284
290
|
}
|
|
285
291
|
exports.default = RabbitMq;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -316,6 +316,11 @@ class RabbitMq implements IAfRabbitMq {
|
|
|
316
316
|
Buffer.from(JSON.stringify(content)),
|
|
317
317
|
RabbitMq.getPublishOptions(customHeaders));
|
|
318
318
|
}
|
|
319
|
+
|
|
320
|
+
async isConnected() : Promise<boolean> {
|
|
321
|
+
const connection = await this.getConnection();
|
|
322
|
+
return connection.isConnected();
|
|
323
|
+
}
|
|
319
324
|
}
|
|
320
325
|
|
|
321
326
|
export default RabbitMq;
|