@onlineapps/conn-infra-mq 1.1.45 → 1.1.46

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.45",
3
+ "version": "1.1.46",
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": {
@@ -36,6 +36,14 @@ class QueueManager {
36
36
  if (!transport || !transport.channel) {
37
37
  throw new Error('MQ client not connected');
38
38
  }
39
+
40
+ // CRITICAL: Business queues MUST be created via setupServiceQueues() AFTER registration
41
+ // Business queues should NOT be created via ensureQueue() before registration
42
+ // This prevents queues from being created with wrong arguments or before service is registered
43
+ if (queueConfig.isBusinessQueue(queueName)) {
44
+ throw new Error(`Business queue ${queueName} must be created via setupServiceQueues() after successful registration. Do not use ensureQueue() for business queues.`);
45
+ }
46
+
39
47
  // Use queueChannel for queue operations to avoid RPC reply queue issues
40
48
  // queueChannel is a regular channel, not ConfirmChannel
41
49
  const channel = transport.queueChannel || transport.channel;
@@ -55,25 +63,6 @@ class QueueManager {
55
63
  console.warn(`[QueueManager] Infrastructure queue config not found for ${queueName}, using provided options:`, error.message);
56
64
  queueOptions = this._buildQueueOptions(queueName, options);
57
65
  }
58
- } else if (queueConfig.isBusinessQueue(queueName)) {
59
- // Business queue - use central business queue config
60
- try {
61
- const parsed = queueConfig.parseBusinessQueue(queueName);
62
- if (parsed) {
63
- const businessConfig = queueConfig.getBusinessQueueConfig(parsed.queueType, parsed.serviceName);
64
- queueOptions = {
65
- durable: businessConfig.durable !== false,
66
- arguments: { ...businessConfig.arguments }
67
- };
68
- } else {
69
- // Fallback to provided options
70
- queueOptions = this._buildQueueOptions(queueName, options);
71
- }
72
- } catch (error) {
73
- // If config not found, fall back to provided options
74
- console.warn(`[QueueManager] Business queue config not found for ${queueName}, using provided options:`, error.message);
75
- queueOptions = this._buildQueueOptions(queueName, options);
76
- }
77
66
  } else {
78
67
  // Unknown queue type - use provided options
79
68
  queueOptions = this._buildQueueOptions(queueName, options);