weyoss / redis-smq

A simple high-performance Redis message queue for Node.js.
MIT License
588 stars 64 forks source link

what is difference between setConsumeTimeout and setTTL #103

Closed ljx0517 closed 1 year ago

ljx0517 commented 1 year ago

I found the method setConsumeTimeout and setTTL, what is the difference?

weyoss commented 1 year ago

@ljx0517 Thank you for opening this issue and for using RedisSMQ.

message.setConsumeTimeout() - This method is useful for setting up a given timeout when a message is being consumed by a consumer. If the timeout exceeds the message processing is cancelled and the message, being processed, is automatically unacknowledged.

message.setTTL() - Allows a message to expire if it has not been delivered to a consumer within a given amount of time.