@onlineapps/conn-infra-mq 1.1.47 → 1.1.48
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
|
@@ -282,22 +282,10 @@ class RabbitMQClient extends EventEmitter {
|
|
|
282
282
|
|
|
283
283
|
if (isInfraQueue) {
|
|
284
284
|
// Infrastructure queue - should already exist, created by infrastructure initialization
|
|
285
|
-
//
|
|
286
|
-
//
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
await this._queueChannel.checkQueue(queue);
|
|
290
|
-
console.log(`[RabbitMQClient] DEBUG: Infrastructure queue ${queue} exists`);
|
|
291
|
-
// Queue exists - proceed to consume
|
|
292
|
-
} catch (checkErr) {
|
|
293
|
-
console.error(`[RabbitMQClient] DEBUG: checkQueue failed for infrastructure queue ${queue}:`, checkErr.message);
|
|
294
|
-
if (checkErr.code === 404) {
|
|
295
|
-
// Queue doesn't exist - infrastructure problem
|
|
296
|
-
throw new Error(`Infrastructure queue '${queue}' not found. Queue should be created during infrastructure initialization.`);
|
|
297
|
-
}
|
|
298
|
-
// Other error - rethrow
|
|
299
|
-
throw checkErr;
|
|
300
|
-
}
|
|
285
|
+
// CRITICAL: Do NOT use checkQueue() - it closes channel on 406 if queue exists with different args
|
|
286
|
+
// Just proceed to consume() - if queue doesn't exist, consume() will fail with clear error
|
|
287
|
+
// This avoids channel closure from checkQueue() on infrastructure queues
|
|
288
|
+
console.log(`[RabbitMQClient] DEBUG: Infrastructure queue ${queue}, skipping checkQueue() - queue should already exist (created by infrastructure initialization)`);
|
|
301
289
|
} else {
|
|
302
290
|
// Business queue - should already be created by setupServiceQueues() BEFORE consume is called
|
|
303
291
|
// CRITICAL: Do NOT use checkQueue() - it closes channel on 404!
|