However in this context the obtained queue is not reliable as messages can be lost, for example in the case there is a network problem or if the consumer crashes just after the message is received but it is still to process.
an atomic operation POP_AND_PUSH (or BLOCKING version for the blocking variant) offers a way to avoid this problem: the consumer fetches the message and at the same time pushes it into a processingqueue (note this is an atomic operation). It will use the REMOVE command in order to remove the message from the processing queue once the message has been processed.
An additional client may monitor the processing queue for items that remain there for too much time, and will push those timed out items into the queue again if needed.