@onlineapps/service-wrapper 2.1.115 → 2.1.116

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/service-wrapper",
3
- "version": "2.1.115",
3
+ "version": "2.1.116",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1092,15 +1092,20 @@ class ServiceWrapper {
1092
1092
  };
1093
1093
 
1094
1094
  if (this.mqClient) {
1095
- try {
1096
- const mqHealth = await this.mqClient.performHealthCheck();
1097
- health.components.mq = mqHealth.healthy ? 'healthy' : 'unhealthy';
1098
- if (!mqHealth.healthy) {
1099
- health.mqIssues = mqHealth.issues;
1095
+ const transport = this.mqClient._transport;
1096
+ if (transport && typeof transport.performHealthCheck === 'function') {
1097
+ try {
1098
+ const mqHealth = await transport.performHealthCheck();
1099
+ health.components.mq = mqHealth.healthy ? 'healthy' : 'unhealthy';
1100
+ if (!mqHealth.healthy) {
1101
+ health.mqIssues = mqHealth.issues;
1102
+ }
1103
+ } catch (e) {
1104
+ health.components.mq = 'unhealthy';
1105
+ health.mqIssues = [e.message];
1100
1106
  }
1101
- } catch (e) {
1102
- health.components.mq = 'unhealthy';
1103
- health.mqIssues = [e.message];
1107
+ } else {
1108
+ health.components.mq = this.mqClient.isConnected() ? 'healthy' : 'unhealthy';
1104
1109
  }
1105
1110
  }
1106
1111