Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AMQPRPCClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AMQPRPCClient extends AMQPEndpoint {
* @param {String} params.requestsQueue queue for sending commands, should correspond with AMQPRPCServer
* @param {String} [params.repliesQueue=''] queue for feedback from AMQPRPCServer,
* default is '' which means auto-generated queue name
* @param {Number} [params.timeout=60000] Timeout for cases when server is not responding
* @param {Number} [params.timeout=60000] Timeout for cases when server is not responding or too busy.
* @param {Object} [params.defaultMessageOptions] additional options for publishing the request to the queue
*/
constructor(connection, params = {}) {
Expand Down Expand Up @@ -52,7 +52,7 @@ class AMQPRPCClient extends AMQPEndpoint {
const replyTo = this._repliesQueue;
const timeout = this._params.timeout;
const requestsQueue = this._params.requestsQueue;
const commonProperties = { replyTo, correlationId };
const commonProperties = { replyTo, correlationId, expiration: timeout };

const properties = Object.assign({},
messageOptions,
Expand Down
6 changes: 3 additions & 3 deletions test/unit/AMQPRPCClient.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('AMQPRPCClient', () => {
expect(channelStub.sendToQueue).to.have.been.calledOnce.and
.calledWith('q',
new Command('test').pack(),
{ correlationId: "0", replyTo: "r", userId: 'john.doe' }
{ correlationId: "0", replyTo: "r", userId: 'john.doe', expiration: 60000 }
);
});

Expand All @@ -73,7 +73,7 @@ describe('AMQPRPCClient', () => {
expect(channelStub.sendToQueue).to.have.been.calledOnce.and
.calledWith('q',
new Command('test', [1, 'foo']).pack(),
{ correlationId: "0", replyTo: "r", userId: 'john.doe' }
{ correlationId: "0", replyTo: "r", userId: 'john.doe', expiration: 60000 }
);
});

Expand All @@ -83,7 +83,7 @@ describe('AMQPRPCClient', () => {
expect(channelStub.sendToQueue).to.have.been.calledOnce.and
.calledWith('q',
new Command('test', [1, 'foo']).pack(),
{ correlationId: "0", replyTo: "r", persistent: false, userId: 'john.doe' }
{ correlationId: "0", replyTo: "r", persistent: false, userId: 'john.doe', expiration: 60000 }
);
});

Expand Down