@onlineapps/service-wrapper 2.0.27 → 2.0.29
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 +2 -2
- package/src/ServiceWrapper.js +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/service-wrapper",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@onlineapps/conn-base-cache": "^1.0.0",
|
|
28
28
|
"@onlineapps/conn-base-monitoring": "^1.0.1",
|
|
29
29
|
"@onlineapps/conn-infra-error-handler": "^1.0.0",
|
|
30
|
-
"@onlineapps/conn-infra-mq": "^1.1.
|
|
30
|
+
"@onlineapps/conn-infra-mq": "^1.1.8",
|
|
31
31
|
"@onlineapps/conn-orch-api-mapper": "^1.0.0",
|
|
32
32
|
"@onlineapps/conn-orch-cookbook": "^2.0.0",
|
|
33
33
|
"@onlineapps/conn-orch-orchestrator": "^1.0.1",
|
package/src/ServiceWrapper.js
CHANGED
|
@@ -258,6 +258,31 @@ class ServiceWrapper {
|
|
|
258
258
|
|
|
259
259
|
await this.mqClient.connect();
|
|
260
260
|
console.log('MQ connector initialized');
|
|
261
|
+
|
|
262
|
+
// Initialize infrastructure queues using unified tool
|
|
263
|
+
// All services (infrastructure AND business) should create infrastructure queues
|
|
264
|
+
// This ensures consistent parameters across all services
|
|
265
|
+
if (this.config.wrapper?.mq?.initInfrastructureQueues !== false) {
|
|
266
|
+
try {
|
|
267
|
+
const { initInfrastructureQueues } = require('@onlineapps/conn-infra-mq').utils || {};
|
|
268
|
+
if (initInfrastructureQueues) {
|
|
269
|
+
// Get channel from transport (RabbitMQClient has channel getter)
|
|
270
|
+
const channel = this.mqClient._transport?.channel || this.mqClient._transport?._channel;
|
|
271
|
+
if (channel) {
|
|
272
|
+
await initInfrastructureQueues(channel, {
|
|
273
|
+
logger: this.logger || console
|
|
274
|
+
});
|
|
275
|
+
console.log('✓ Infrastructure queues initialized');
|
|
276
|
+
} else {
|
|
277
|
+
console.warn('⚠ Could not get channel from MQ transport');
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
} catch (error) {
|
|
281
|
+
// If tool not available or fails, log warning but continue
|
|
282
|
+
// Infrastructure queues may have been created by other services
|
|
283
|
+
console.warn('⚠ Could not initialize infrastructure queues:', error.message);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
261
286
|
}
|
|
262
287
|
|
|
263
288
|
/**
|