watermill
watermill copied to clipboard
[watermill-nats] Watermill command bus cannot recover from "stan: connection closed" on Stan restart
Used in Kubernetes environment have to reschedule the Stan pod, which changed the underlying IP address which it used. After that the command bus was constantly throwing "sending message failed: stan: connection closed" error even if the pod has successfully rescheduled.
I've checked the Publisher class in the package here https://github.com/ThreeDotsLabs/watermill-nats/blob/master/pkg/nats/publisher.go#L84-L108
In my scenario the app connects to the Stan service via DNS (Kubernetes service).