rabbit-queue
Advanced tools
Comparing version 5.0.0-beta.0 to 5.0.0-beta.1
@@ -52,3 +52,3 @@ "use strict"; | ||
if (this.scope === BaseQueueHandler.SCOPES.singleton) { | ||
this.tryHandle(0, msg, ack).catch(e => this.logger.error(e)); | ||
this.tryHandle(0, msg, ack).catch((e) => this.logger.error(e)); | ||
} | ||
@@ -62,11 +62,11 @@ else { | ||
scope: this.scope, | ||
createAndSubscribeToQueue: false | ||
createAndSubscribeToQueue: false, | ||
}); | ||
instance.tryHandle(0, msg, ack).catch(e => this.logger.error(e)); | ||
instance.tryHandle(0, msg, ack).catch((e) => this.logger.error(e)); | ||
} | ||
}) | ||
.catch(error => this.logger.error(error)); | ||
.catch((error) => this.logger.error(error)); | ||
this.dlq = yield this.rabbit | ||
.createQueue(this.dlqName, this.getDlqOptions()) | ||
.catch(error => this.logger.error(error)); | ||
.catch((error) => this.logger.error(error)); | ||
}); | ||
@@ -90,3 +90,3 @@ } | ||
this.handleError(err, msg); | ||
this.retry(retries, msg, ack).catch(error => this.logger.error(error)); | ||
this.retry(retries, msg, ack).catch((error) => this.logger.error(error)); | ||
} | ||
@@ -101,3 +101,3 @@ }); | ||
stack: err.stack && err.stack.substr(0, 200), | ||
time: new Date().toString() | ||
time: new Date().toString(), | ||
}; | ||
@@ -136,3 +136,3 @@ } | ||
const event = encode_decode_1.decode(msg); | ||
this.logger.warn('[%s] Adding to dlq: %s after %s retries', correlationId, this.dlqName, retries); | ||
this.logger.warn(`[${correlationId}] Adding to dlq: ${this.dlqName} after ${retries} retries`); | ||
yield this.rabbit.publish(this.dlqName, event, msg.properties); | ||
@@ -139,0 +139,0 @@ const response = yield this.afterDlq({ msg, event }); |
@@ -6,2 +6,3 @@ export default function getLogger(component: any): { | ||
error: (...args: any[]) => Promise<any>; | ||
trace: (...args: any[]) => Promise<any>; | ||
}; |
@@ -13,3 +13,3 @@ "use strict"; | ||
function getLogger(component) { | ||
const logger = level => (...args) => __awaiter(this, void 0, void 0, function* () { | ||
const logger = (level) => (...args) => __awaiter(this, void 0, void 0, function* () { | ||
const rabbit = (yield Promise.resolve().then(() => require('./rabbit'))).default; | ||
@@ -25,3 +25,4 @@ if (rabbit.INSTANCE && rabbit.INSTANCE.listenerCount('log') > 0) { | ||
info: logger('info'), | ||
error: logger('erro') | ||
error: logger('error'), | ||
trace: logger('trace'), | ||
}; | ||
@@ -28,0 +29,0 @@ } |
{ | ||
"name": "rabbit-queue", | ||
"version": "5.0.0-beta.0", | ||
"version": "5.0.0-beta.1", | ||
"description": "AMQP/RabbitMQ queue management library.", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
121154
1479