I have some old code with architecture that is combining socketIO and Nats for message handling.
Basically users are connected to the socketIO pods, those pods are connected to the Nats cluster of pods (3 of them) and users listeners are directly connected to the Nats pods.
That is working fine (I know that it is not nor optimal nor good but its how it is for now I cannot change it because its too massive and it has critical impact to my project)
My question is what would be best approach here to introduce some message guaranteeing, I have already read some posts and I understand two generals problem, but I was thinking about using nats JetStram as temporary storage for transfered messaged (I think about it as integrated redis into nats some K/V table maybe I’m wrong) and those messages when they arrive they would inform Nats to resolve them and remove from table and if there is more then some x period of seconds of waiting nats would inform user that message was not delivered.
So that’s some rough idea, I don’t know if its good, and I would like to hear if someone has similar projects/architectures and how do you handle that messages are arriving from point A to point B, and what would be your advice for my problem.
Thanks in advance.