Subscribe to Nomad Event stream Restart service to re-consume

I’m using nomad event stream to monitor the termination status of the container task in nomad, and I’m having a problem that when I restart the service that subscribes to nomad event stream, it re-reads the events that have been processed in nomad (all events that have occurred previously). I don’t know how I can solve this problem so that I can restart my service without having to deal with the previously processed events.

Hi @wangyuanhang111,

You application that consumes events will need to track, in some manner, the last index it processed and then read this value upon restart. A simple method of achieving this might be to write a file to disk which contains this value.

Please let me know if you have any followup questions.

jrasell and the Nomad team