@onlineapps/infrastructure-tools 1.0.21 → 1.0.23
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/infrastructure-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "Infrastructure orchestration utilities for OA Drive infrastructure services (health tracking, queue initialization, service discovery)",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"author": "OnlineApps",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onlineapps/mq-client-core": "^1.0.
|
|
24
|
-
"@onlineapps/service-common": "^1.0.
|
|
23
|
+
"@onlineapps/mq-client-core": "^1.0.47",
|
|
24
|
+
"@onlineapps/service-common": "^1.0.5",
|
|
25
25
|
"uuid": "^9.0.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -48,7 +48,6 @@ async function initInfrastructureQueues(channel, options = {}) {
|
|
|
48
48
|
'workflow.dlq',
|
|
49
49
|
// Registry infrastructure queues
|
|
50
50
|
'registry.register',
|
|
51
|
-
'registry.heartbeats'
|
|
52
51
|
];
|
|
53
52
|
|
|
54
53
|
const watchChannel = (ch) => {
|
|
@@ -84,8 +83,10 @@ async function initInfrastructureQueues(channel, options = {}) {
|
|
|
84
83
|
|
|
85
84
|
for (const queueName of queuesToCreate) {
|
|
86
85
|
try {
|
|
86
|
+
logger.log(`[QueueInit] Processing queue: ${queueName}...`);
|
|
87
87
|
// Verify it's an infrastructure queue
|
|
88
88
|
const isInfra = queueConfig.isInfrastructureQueue(queueName);
|
|
89
|
+
logger.log(`[QueueInit] isInfrastructureQueue("${queueName}"): ${isInfra}`);
|
|
89
90
|
if (!isInfra) {
|
|
90
91
|
logger.warn(`[QueueInit] Skipping ${queueName} - not an infrastructure queue (isInfrastructureQueue returned: ${isInfra})`);
|
|
91
92
|
// Debug: log the actual function code to verify it's the right version
|
|
@@ -94,7 +95,18 @@ async function initInfrastructureQueues(channel, options = {}) {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
// Get unified configuration
|
|
97
|
-
|
|
98
|
+
logger.log(`[QueueInit] Getting config for ${queueName}...`);
|
|
99
|
+
let config;
|
|
100
|
+
try {
|
|
101
|
+
config = queueConfig.getInfrastructureQueueConfig(queueName);
|
|
102
|
+
logger.log(`[QueueInit] Config for ${queueName}:`, JSON.stringify(config));
|
|
103
|
+
} catch (configError) {
|
|
104
|
+
logger.error(`[QueueInit] ✗ Failed to get config for ${queueName}:`, {
|
|
105
|
+
error: configError.message,
|
|
106
|
+
stack: configError.stack
|
|
107
|
+
});
|
|
108
|
+
throw configError;
|
|
109
|
+
}
|
|
98
110
|
|
|
99
111
|
// CRITICAL: First check if queue exists and what parameters it has
|
|
100
112
|
// This prevents 406 errors by proactively deleting queues with wrong parameters
|
|
@@ -142,7 +154,7 @@ async function initInfrastructureQueues(channel, options = {}) {
|
|
|
142
154
|
} catch (checkError) {
|
|
143
155
|
// Queue doesn't exist - will be created
|
|
144
156
|
queueExists = false;
|
|
145
|
-
logger.log(`[QueueInit] Queue ${queueName} does not exist - will be created`);
|
|
157
|
+
logger.log(`[QueueInit] Queue ${queueName} does not exist (${checkError.code || checkError.message}) - will be created`);
|
|
146
158
|
// Close check channel if queue doesn't exist
|
|
147
159
|
if (checkChannelForDelete) {
|
|
148
160
|
try {
|
|
@@ -197,9 +209,16 @@ async function initInfrastructureQueues(channel, options = {}) {
|
|
|
197
209
|
};
|
|
198
210
|
|
|
199
211
|
try {
|
|
212
|
+
logger.log(`[QueueInit] Calling assertQueue for ${queueName}...`);
|
|
200
213
|
await ensureQueue();
|
|
201
214
|
logger.log(`[QueueInit] ✓ Created/verified infrastructure queue: ${queueName}`);
|
|
202
215
|
} catch (assertError) {
|
|
216
|
+
logger.error(`[QueueInit] ✗ Failed to create/verify queue ${queueName}:`, {
|
|
217
|
+
error: assertError.message,
|
|
218
|
+
code: assertError.code,
|
|
219
|
+
classId: assertError.classId,
|
|
220
|
+
methodId: assertError.methodId
|
|
221
|
+
});
|
|
203
222
|
if (assertError.code === 406) {
|
|
204
223
|
if (alertOnMismatch) {
|
|
205
224
|
try {
|