specify a flow service for Document resolver service and re-publish the Document back to the queue in this flow service.
But this will create a new envelope with new timestamps etc.
i am able to use Document resolver service only when the document status is InDoubt , The requirement is if the document is duplicate , It needs to wait for certain time (TTL) and reprocess again.
If exactly once is not suitable for this , is there any other options to use here.
in this case you will have to build some custom logic where you check in the triggered service if this is a duplicate or not.
When it is a duplicate, you can republish the document to your queue where it will be queued at the end of the queue.
Before this document can be processed again all other documents in the queue will be processed then.
When it is processed again, you need to check if this is first occurance of the duplicate (-> publish) or second (-> process).
Please have a look at the IS Built-In Services Reference as you might find some helpful services here (i.e the folders pub.cache and pub.storage)