@onlineapps/service-wrapper 2.0.31 → 2.0.33
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 +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/service-wrapper",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.33",
|
|
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.9",
|
|
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
|
@@ -212,12 +212,13 @@ class ServiceWrapper {
|
|
|
212
212
|
async _initializeMonitoring() {
|
|
213
213
|
const serviceName = this.config.service?.name || 'unnamed-service';
|
|
214
214
|
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
// Init returns API object with logger, info, error, warn, debug methods
|
|
216
|
+
this.monitoring = await MonitoringConnector.init({
|
|
217
217
|
serviceName,
|
|
218
218
|
...this.config.wrapper?.monitoring
|
|
219
219
|
});
|
|
220
220
|
|
|
221
|
+
// Logger is the API object returned from init (has logger, info, error, warn, debug)
|
|
221
222
|
this.logger = this.monitoring;
|
|
222
223
|
// Logger is now available, use it
|
|
223
224
|
this.logger.info('Monitoring connector initialized');
|
|
@@ -257,6 +258,8 @@ class ServiceWrapper {
|
|
|
257
258
|
this.mqClient = new MQConnector({
|
|
258
259
|
type: 'rabbitmq',
|
|
259
260
|
host: mqUrl,
|
|
261
|
+
serviceName,
|
|
262
|
+
autoSetupServiceQueues: false,
|
|
260
263
|
queue: `${serviceName}.workflow`,
|
|
261
264
|
prefetch: this.config.wrapper?.mq?.prefetch || 10,
|
|
262
265
|
durable: true,
|
|
@@ -328,6 +331,14 @@ class ServiceWrapper {
|
|
|
328
331
|
// Both workflow.init and service-specific listeners start here
|
|
329
332
|
if (registrationResult.success && registrationResult.certificate) {
|
|
330
333
|
this.logger?.info('✓ Certificate validated, starting workflow listeners...');
|
|
334
|
+
try {
|
|
335
|
+
await this.mqClient.setupServiceQueues(serviceName, { includeWorkflow: true });
|
|
336
|
+
this.logger?.info('✓ Business queues initialized via QueueManager');
|
|
337
|
+
} catch (queueError) {
|
|
338
|
+
this.logger?.error('Failed to initialize business queues', { error: queueError.message });
|
|
339
|
+
throw new Error(`Failed to initialize business queues for ${serviceName}: ${queueError.message}`);
|
|
340
|
+
}
|
|
341
|
+
|
|
331
342
|
// Start workflow.init listener (for all services)
|
|
332
343
|
await this._startWorkflowInitListener();
|
|
333
344
|
// Start service-specific workflow listener
|