Skip to content

Commit d50435a

Browse files
authored
fix: Oeco stability 10 (#70)
* fix: improving nats debugging. Need to update the Health Checker * fix: improving nats debugging. Need to update the Health Checker --------- Co-authored-by: Dimy Jeannot <>
1 parent 283f3ba commit d50435a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

go/oeco-sdk/v2beta/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
### 🚀 Features
44

5-
- Oeco stability 8 ([#69](https://github.com/openecosystems/ecosystem/pull/69))
5+
- Oeco stability 8 ([#69](https://github.com/openecosystems/ecosystem/pull/69))
66

77
### ❤️ Thank You
88

9-
- Dimy Jeannot @dimyjeannot
9+
- Dimy Jeannot @dimyjeannot
1010

1111
## 0.18.0 (2025-07-26)
1212

go/oeco-sdk/v2beta/bindings/nats/binding.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/nats-io/nats.go"
1313
"github.com/nats-io/nats.go/jetstream"
1414

15+
apexlog "github.com/apex/log"
1516
sdkv2betalib "github.com/openecosystems/ecosystem/go/oeco-sdk/v2beta"
1617
nebulav1 "github.com/openecosystems/ecosystem/go/oeco-sdk/v2beta/bindings/nebula"
1718
)
@@ -126,6 +127,15 @@ func (b *Binding) Bind(_ context.Context, bindings *sdkv2betalib.Bindings) *sdkv
126127
}
127128

128129
natsOptions = append(natsOptions, nats.SetCustomDialer(nebulav1.Bound.MeshSocket))
130+
natsOptions = append(natsOptions, nats.DisconnectErrHandler(func(_ *nats.Conn, err error) {
131+
apexlog.Info("Disconnected due to: " + err.Error())
132+
}))
133+
natsOptions = append(natsOptions, nats.ReconnectHandler(func(nc *nats.Conn) {
134+
apexlog.Info("Reconnected to " + nc.ConnectedUrl())
135+
}))
136+
natsOptions = append(natsOptions, nats.ClosedHandler(func(_ *nats.Conn) {
137+
apexlog.Info("Connection closed.")
138+
}))
129139
}
130140

131141
_nats, err := nats.Connect(servers, natsOptions...)

0 commit comments

Comments
 (0)