@onlineapps/conn-infra-mq 1.1.24 → 1.1.25

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/conn-infra-mq",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "A promise-based, broker-agnostic client for sending and receiving messages via RabbitMQ",
5
5
  "main": "src/index.js",
6
6
  "repository": {
@@ -311,18 +311,12 @@ class QueueManager {
311
311
  }
312
312
 
313
313
  // If 406 PRECONDITION-FAILED, queue exists with different args - use it as-is
314
+ // CRITICAL: Do NOT use checkQueue() here - it closes channel on 404!
315
+ // If assertQueue() returned 406, queue exists (just with different args) - that's OK
314
316
  if (assertErr.code === 406) {
315
317
  console.warn(`[QueueManager] Queue ${queueName} exists with different arguments, using as-is:`, assertErr.message);
316
- // Verify queue exists
317
- if (!channel || channel.closed) {
318
- throw new Error(`Channel closed after 406 error for ${queueName}`);
319
- }
320
- try {
321
- await channel.checkQueue(queueName);
322
- queues[queueInfo.type] = queueName;
323
- } catch (checkErr) {
324
- throw new Error(`Failed to verify existing queue ${queueName}: ${checkErr.message}`);
325
- }
318
+ // Queue exists (just with different args) - accept it
319
+ queues[queueInfo.type] = queueName;
326
320
  } else {
327
321
  // Other error - critical, cannot continue
328
322
  throw new Error(`Failed to create business queue ${queueName}: ${assertErr.message}`);