@onlineapps/service-wrapper 2.0.2 → 2.0.4
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 +1 -1
- package/src/ServiceWrapper.js +15 -5
package/package.json
CHANGED
package/src/ServiceWrapper.js
CHANGED
|
@@ -235,12 +235,22 @@ class ServiceWrapper {
|
|
|
235
235
|
* @returns {Promise<void>}
|
|
236
236
|
*/
|
|
237
237
|
async _initializeConnectors() {
|
|
238
|
-
// Initialize MQ client
|
|
238
|
+
// Initialize MQ client with correct config format
|
|
239
|
+
const rabbitUrl = this.config.rabbitmq || process.env.RABBITMQ_URL || 'amqp://localhost:5672';
|
|
240
|
+
|
|
239
241
|
this.mqClient = new MQConnector({
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
type: 'rabbitmq',
|
|
243
|
+
host: rabbitUrl,
|
|
244
|
+
queue: `${this.serviceName}.workflow`,
|
|
245
|
+
prefetch: this.config.prefetch || 10,
|
|
246
|
+
durable: true,
|
|
247
|
+
noAck: false,
|
|
248
|
+
logger: {
|
|
249
|
+
info: (...args) => this.logger.info(...args),
|
|
250
|
+
warn: (...args) => this.logger.warn(...args),
|
|
251
|
+
error: (...args) => this.logger.error(...args),
|
|
252
|
+
debug: (...args) => this.logger.debug(...args)
|
|
253
|
+
}
|
|
244
254
|
});
|
|
245
255
|
await this.mqClient.connect();
|
|
246
256
|
|