@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/conn-infra-mq",
3
- "version": "1.1.47",
3
+ "version": "1.1.48",
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": {
@@ -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
- // Use queueChannel (regular channel) for queue operations to avoid RPC reply queue issues
286
- // Only check if it exists, don't try to create or assert with arguments
287
- console.log(`[RabbitMQClient] DEBUG: Infrastructure queue ${queue}, checking existence...`);
288
- try {
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!