@onlineapps/conn-infra-mq 1.1.53 → 1.1.54

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.53",
3
+ "version": "1.1.54",
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": {
@@ -80,26 +80,9 @@ class ConnectorMQClient extends BaseClient {
80
80
  this.workflow = new WorkflowRouter(this, config);
81
81
  this.queues = new QueueManager(this, config);
82
82
 
83
- // Setup queue creation callback for RecoveryWorker (delegates to QueueManager)
84
- // This ensures RecoveryWorker uses QueueManager for queue creation instead of direct creation
85
- // Note: We create a closure that will access this.queues after it's initialized
86
- let queueManagerRef = null;
87
- const queueCreationCallback = async (queueName, options = {}) => {
88
- if (!queueManagerRef) {
89
- throw new Error('QueueManager not initialized - cannot create queue via RecoveryWorker');
90
- }
91
- // Use ensureQueue for individual queues (RecoveryWorker handles single queue creation)
92
- // Note: setupServiceQueues creates multiple queues, but RecoveryWorker only needs one
93
- // However, ensureQueue throws for business queues, so we need to handle that
94
- try {
95
- await queueManagerRef.ensureQueue(queueName, options);
96
- } catch (err) {
97
- // If ensureQueue fails because it's a business queue, we can't create it via RecoveryWorker
98
- // RecoveryWorker should only handle transient errors, not business queue creation
99
- // Business queues must be created via setupServiceQueues() after registration
100
- throw new Error(`Cannot create business queue '${queueName}' via RecoveryWorker. Business queues must be created via setupServiceQueues() after registration.`);
101
- }
102
- };
83
+ // Set reference for queueCreationCallback closure
84
+ queueManagerRef = this.queues;
85
+
103
86
  this.retry = new RetryHandler(this, config);
104
87
  this.forkJoin = new ForkJoinHandler(this, this.queues, config);
105
88