@onlineapps/conn-infra-mq 1.1.23 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/conn-infra-mq",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
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": {
@@ -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
- // Use queueChannel (regular channel) for queue operations to avoid RPC reply queue issues
227
- // Only check if it exists - don't try to create it here (that's setupServiceQueues() responsibility)
228
- try {
229
- await this._queueChannel.checkQueue(queue);
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