rsmq icon indicating copy to clipboard operation
rsmq copied to clipboard

Allow custom IDs to be passed into sendMessage

Open charles-toller opened this issue 4 years ago • 2 comments

Allow choosing an ID rather than letting the library choose one. Useful when you already want to reference an out-of-band object with an UUID.

charles-toller avatar Jan 04 '21 19:01 charles-toller

What happens if you send a message with an ID that already exists in the queue?

rogerweb avatar Jan 05 '21 12:01 rogerweb

If you send a message that already exists in the queue, it will update the minimum delay before the message is picked up to the current timestamp plus options.delay, if you have that set. It will also overwrite the message, but not any of it's properties, like last received, receive count, and so on.

Rather than do any of that, should we just throw an error if the message exists and force you to delete the old message first, or should we just completely replace all the properties on the message?

charles-toller avatar Jan 05 '21 22:01 charles-toller