Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Commit

Permalink
fixes #104
Browse files Browse the repository at this point in the history
  • Loading branch information
arafato committed Nov 27, 2017
1 parent 1c4d185 commit 4771b77
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/model/queue/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Message {
this.timeNextVisible = now + parseInt(visibilityTimeout);
this.messageId = uuidv4();
this.insertionTime = now;
this.popReceipt = uuidv4();
this.popReceipt = undefined;
this.dequeueCount = 0;
}

Expand Down
1 change: 1 addition & 0 deletions lib/model/queue/Queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Queue {
.slice(0, numOfMessages)
.map((i) => {
++i.dequeueCount;
i.renewPopReceipt();
i.updateVisibilityTimeout(visibilityTimeout)
return i;
});
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/queue/MessageRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const env = require('./../../core/env'),
* for details on specification.
*/
module.exports = (app) => {
app.route(`/${env.emulatedStorageAccountName}/:queue/messages/?*`)
app.route(`/${env.emulatedStorageAccountName}/:queue/messages/:messageId*?`)
.get((req, res, next) => {
if (req.query.peekonly === 'true') {
req.azuriteOperation = Operations.Queue.PEEK_MESSAGES;
Expand All @@ -37,7 +37,7 @@ module.exports = (app) => {
});
})
.delete((req, res, next) => {
if (req.params.messageid) {
if (req.params.messageId) {
req.azuriteOperation = Operations.Queue.DELETE_MESSAGE;
} else {
req.azuriteOperation = Operations.Queue.CLEAR_MESSAGES;
Expand Down
2 changes: 1 addition & 1 deletion lib/validation/queue/PopReceipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PopReceipt {

validate({ request = undefined }) {
const msg = QueueManager.getQueueAndMessage({ queueName: request.queueName, messageId: request.messageId }).message;
if (msg.PopReceipt !== request.popReceipt) {
if (msg.popReceipt !== request.popReceipt) {
throw new AError(ErrorCodes.PopReceiptMismatch);
}
}
Expand Down
3 changes: 2 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# 1.0
## 1.4
- fixes [#104](https://github.com/arafato/azurite/issues/104): Queue Storage: Adds support for DeleteMessage
## 1.3
### 1.3.1
- fixes [#103](https://github.com/arafato/azurite/issues/103): Queue Storage: Adds support for PeekMessages
- fixes [#105](https://github.com/arafato/azurite/issues/105): Queue Storage: Adds support for ClearMessages
- fixes [#102](https://github.com/arafato/azurite/issues/102): Queue Storage: Adds support for GetMessages

- fixes [#101](https://github.com/arafato/azurite/issues/101): Queue Storage: Adds support for PutMessage
### 1.3.0
- fixes [#110](https://github.com/arafato/azurite/issues/110): fixed require directive for QueueManager
Expand Down

0 comments on commit 4771b77

Please sign in to comment.