My question is about the second assumption, shouldn't it be changed to exactly one delivery
?
No, because the message can actually be delivered to a consumer multiple times. exactly-once processing is a more appropriate naming convention because acknowledging/deleting the message from the queue is part of "processing" the message.
This is in contrast to standard queues, where a message can appear on the queue multiple times, for example, due to retries in the message producer. The "FIFO delivery logic" section of the docs cover this in more extensive details.
we still need to have idempotent workers even when using FIFO queues
Yes, that's correct. Whether or not you are using a FIFO queue, idempotency is still an important consideration for your application; you can't ignore it just because you use a FIFO queue. This may be misleading based on a different interpretation of what "processing" means. The queue cannot tell whether the work associated with the message is actually performed -- the system only cares if the message is deleted or not because it needs to deliver the message again if it is not deleted.
Also consider it's completely in the realm of possibility for a consumer to acknowledge a message either before or after work is actually performed.
To illustrate both points, take for example a basic queue consumer workflow:
- A worker (consumer) picks up a message from the queue. Here, the visibility timeout starts.
- The worker performs some task according to the message (say, attempt a bank transaction)
- Upon performing the task, the worker then deletes the message, removing it from the queue.
Now, suppose that the worker system experiences sudden failure sometime between steps 1 and 3. The work may (or may not!) have been completed, but the message won't be deleted. Once the visibility timeout expires, the message will be visible to be picked up by another worker.
Therefore, it is necessary for the worker to be able to ascertain the true state of the system. For example, whether or not the transaction related to the message has been performed or not.
There are numerous other considerations in how FIFO queues prevent deduplication that you must consider in the design of your system.