LinuxForHealth/connect

Exactly-once delivery via NATS JetStream

Opened this issue · 2 comments

Implement and refine a double-ack for exactly-once delivery. Create a JetStream Consumer for every LinuxForHealth sync target (NATS sync subscriber).

The implementation needs in-progress changes to nats.py, the NATS python client, to support JetStream. Once those changes are in place, we can proceed with the exactly-once implementation.

To get exactly once semantics, we need the ability to specify the name of the consumer as part of the subscription, so each LFH node can use a different consumer and can thereby separately double-ack the same message. Basically the equivalent of the go example, where the second arg is the name of the consumer to use:

sub, err := js.SubscribeSync("ORDERS.*", nats.Durable("MONITOR"), nats.MaxDeliver(3))

We don't have that js.SubscribeSync for Python yet, but it's coming soon from the NATS team.