@onlineapps/conn-infra-mq 1.1.22 → 1.1.24
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
|
@@ -223,25 +223,10 @@ class RabbitMQClient extends EventEmitter {
|
|
|
223
223
|
}
|
|
224
224
|
} else {
|
|
225
225
|
// Business queue - should already be created by setupServiceQueues() BEFORE consume is called
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
// Queue exists - proceed to consume
|
|
231
|
-
} catch (checkErr) {
|
|
232
|
-
if (checkErr.code === 404) {
|
|
233
|
-
// Queue doesn't exist - this is an error, queue should have been created by setupServiceQueues()
|
|
234
|
-
throw new Error(`Business queue '${queue}' not found. Queue should be created by setupServiceQueues() before consuming.`);
|
|
235
|
-
}
|
|
236
|
-
// Other error (including 406) - queue exists with different args, use it as-is
|
|
237
|
-
if (checkErr.code === 406) {
|
|
238
|
-
console.warn(`[RabbitMQClient] Queue ${queue} exists with different arguments, using as-is:`, checkErr.message);
|
|
239
|
-
// Proceed to consume - queue exists, just with different args
|
|
240
|
-
} else {
|
|
241
|
-
// Other error - rethrow
|
|
242
|
-
throw checkErr;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
226
|
+
// CRITICAL: Do NOT use checkQueue() - it closes channel on 404!
|
|
227
|
+
// If queue doesn't exist, that's a programming error (setupServiceQueues() should have created it)
|
|
228
|
+
// Just proceed to consume - if queue doesn't exist, consume will fail with a clear error
|
|
229
|
+
// This avoids channel closure from checkQueue() on non-existent queues
|
|
245
230
|
}
|
|
246
231
|
}
|
|
247
232
|
// Set prefetch if provided
|