Skip to content

Commit

Permalink
Merge pull request #26 from signalive/deniz
Browse files Browse the repository at this point in the history
Deniz
  • Loading branch information
mertdogar authored Aug 16, 2017
2 parents bc3325c + d1357c5 commit e70a2e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "microservice-kit",
"version": "0.3.14",
"version": "0.4.0",
"description": "Utility belt for building microservices",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class Exchange {
options.correlationId = uuid();
options.replyTo = this.rpc_.getUniqueQueueName();

if (_.isNumber(options.timeout) && options.timeout > 0) {
options.expiration = options.timeout.toString();
}

const rv = new Promise((resolve, reject) => {
this.log_('info', 'Publishing event', {
eventName,
Expand Down
4 changes: 4 additions & 0 deletions src/lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ class Queue {
options.correlationId = uuid();
options.replyTo = this.rpc_.getUniqueQueueName();

if (_.isNumber(options.timeout) && options.timeout > 0) {
options.expiration = options.timeout.toString();
}

const rv = new Promise((resolve, reject) => {
this.log_('info', 'Sending event to queue', {
eventName,
Expand Down

0 comments on commit e70a2e1

Please sign in to comment.