@onlineapps/mq-client-core 1.0.26 → 1.0.27
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
|
@@ -185,11 +185,23 @@ class RabbitMQClient extends EventEmitter {
|
|
|
185
185
|
// Queue exists - proceed to publish
|
|
186
186
|
} catch (checkErr) {
|
|
187
187
|
// If queue doesn't exist (404), this is an ERROR for infrastructure queues
|
|
188
|
-
// Infrastructure queues (workflow.*, registry.*) must be created explicitly with correct arguments
|
|
188
|
+
// Infrastructure queues (workflow.*, registry.*, infrastructure.*, monitoring.*, validation.*) must be created explicitly with correct arguments
|
|
189
189
|
// We should NOT auto-create them here, as we don't have access to queueConfig in mq-client-core
|
|
190
190
|
if (checkErr.code === 404) {
|
|
191
|
-
// Check if this is an infrastructure queue
|
|
192
|
-
|
|
191
|
+
// Check if this is an infrastructure queue using queueConfig
|
|
192
|
+
let isInfraQueue = false;
|
|
193
|
+
try {
|
|
194
|
+
const queueConfig = require('../config/queueConfig');
|
|
195
|
+
isInfraQueue = queueConfig.isInfrastructureQueue(queue);
|
|
196
|
+
} catch (requireErr) {
|
|
197
|
+
// Fallback to pattern matching if queueConfig not available
|
|
198
|
+
isInfraQueue = queue.startsWith('workflow.') ||
|
|
199
|
+
queue.startsWith('registry.') ||
|
|
200
|
+
queue.startsWith('infrastructure.') ||
|
|
201
|
+
queue.startsWith('monitoring.') ||
|
|
202
|
+
queue.startsWith('validation.');
|
|
203
|
+
}
|
|
204
|
+
|
|
193
205
|
if (isInfraQueue) {
|
|
194
206
|
throw new Error(`Cannot publish to infrastructure queue ${queue}: queue does not exist. Infrastructure queues must be created explicitly with correct arguments (TTL, max-length, etc.) before publishing.`);
|
|
195
207
|
}
|