-
I have some requirement is like i want to build a persistent database to know which queue are sent to nats, which are in processing and which are processed think like a Task Queue table in Postgres Database Task Queue Table id: string
event_name: string (payment_created)
status: string (created, processing, failed)
body: JSON |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
@khanakia, Would this fit your requirement |
Beta Was this translation helpful? Give feedback.
-
Not sure I'm understanding the discussion or why PostgreSQL would be needed here. You can publish into JetStream and wait for a puback for confirmation that JetStream received your message, and after that you can replay it up to as many times as you want if needed (depending on what retention policy you choose or what you decide to do with the message). This is a very common robust queuing pattern. |
Beta Was this translation helpful? Give feedback.
The thing to understand is that acknowledging a message does not remove it from the stream unless you choose a mode that does that.
With Limits policy streams all messages stays even after they were acknowledged and if you make a new consumer over the stream you will get the exact same messages again.
Indeed we do not track to very granular extend who and when a message was ack'd but you can see from any consumer where in the stream its up to and acknowledged.