@onlineapps/mq-client-core 1.0.40 → 1.0.41
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
|
@@ -232,6 +232,14 @@ class RabbitMQClient extends EventEmitter {
|
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Check if client is connected
|
|
237
|
+
* @returns {boolean} True if connection exists and is not closed
|
|
238
|
+
*/
|
|
239
|
+
isConnected() {
|
|
240
|
+
return !!(this._connection && !this._connection.closed);
|
|
241
|
+
}
|
|
242
|
+
|
|
235
243
|
/**
|
|
236
244
|
* Getter for channel - provides compatibility with QueueManager
|
|
237
245
|
* Returns ConfirmChannel for publish operations
|
|
@@ -1110,6 +1118,21 @@ class RabbitMQClient extends EventEmitter {
|
|
|
1110
1118
|
// Jasný, hlasitý signál pro infra služby – fronta chybí, je to programátorská chyba
|
|
1111
1119
|
throw new QueueNotFoundError(queue, true, checkErr);
|
|
1112
1120
|
}
|
|
1121
|
+
// For non-infrastructure queues, check if queue creation is allowed before auto-creating
|
|
1122
|
+
// Check recovery scope and filter
|
|
1123
|
+
if (this._recoveryWorker && !this._recoveryWorker._queueCreationEnabled) {
|
|
1124
|
+
// Queue creation disabled for this scope (e.g., infrastructure scope)
|
|
1125
|
+
throw new QueueNotFoundError(queue, false, checkErr);
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// Check queue creation filter if provided
|
|
1129
|
+
if (this._recoveryWorker && this._recoveryWorker._queueCreationFilter) {
|
|
1130
|
+
if (!this._recoveryWorker._queueCreationFilter(queue)) {
|
|
1131
|
+
// Queue creation filtered out - throw QueueNotFoundError so RecoveryWorker can handle it
|
|
1132
|
+
throw new QueueNotFoundError(queue, false, checkErr);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1113
1136
|
// For non-infrastructure queues, allow auto-creation with default options
|
|
1114
1137
|
const queueOptions = options.queueOptions || { durable: this._config.durable };
|
|
1115
1138
|
console.warn(`[RabbitMQClient] [mq-client-core] [PUBLISH] Auto-creating non-infrastructure queue ${queue} with default options (no TTL). This should be avoided for production.`);
|