@onlineapps/conn-infra-mq 1.1.13 → 1.1.14
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
|
@@ -57,13 +57,25 @@ class RabbitMQClient extends EventEmitter {
|
|
|
57
57
|
this.emit('error', new Error('RabbitMQ connection closed unexpectedly'));
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
// Use ConfirmChannel to enable publisher confirms
|
|
60
|
+
// Use ConfirmChannel to enable publisher confirms for publish operations
|
|
61
|
+
// BUT: Create a separate regular channel for queue operations to avoid RPC reply queue issues
|
|
61
62
|
this._channel = await this._connection.createConfirmChannel();
|
|
62
63
|
this._channel.on('error', (err) => this.emit('error', err));
|
|
63
64
|
this._channel.on('close', () => {
|
|
64
65
|
// Emit a channel close error
|
|
65
66
|
this.emit('error', new Error('RabbitMQ channel closed unexpectedly'));
|
|
66
67
|
});
|
|
68
|
+
|
|
69
|
+
// Create a separate regular channel for queue operations (assertQueue, checkQueue)
|
|
70
|
+
// This avoids RPC reply queue issues with ConfirmChannel.assertQueue()
|
|
71
|
+
this._queueChannel = await this._connection.createChannel();
|
|
72
|
+
this._queueChannel.on('error', (err) => {
|
|
73
|
+
// Log but don't emit - queue channel errors are less critical
|
|
74
|
+
console.warn('[RabbitMQClient] Queue channel error:', err.message);
|
|
75
|
+
});
|
|
76
|
+
this._queueChannel.on('close', () => {
|
|
77
|
+
console.warn('[RabbitMQClient] Queue channel closed');
|
|
78
|
+
});
|
|
67
79
|
} catch (err) {
|
|
68
80
|
// Cleanup partially created resources
|
|
69
81
|
if (this._connection) {
|