Skip to content

Commit 759891c

Browse files
committed
fix: reuse session to receive data from subscriptions after reconnect
1 parent d3075c9 commit 759891c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/mqtt/client.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func NewClient(o Options) (Client, error) {
4747
opts.SetPingTimeout(60 * time.Second)
4848
opts.SetKeepAlive(60 * time.Second)
4949
opts.SetAutoReconnect(true)
50+
opts.SetCleanSession(false)
5051
opts.SetMaxReconnectInterval(10 * time.Second)
5152
opts.SetConnectionLostHandler(func(c paho.Client, err error) {
5253
log.DefaultLogger.Error("MQTT Connection lost", "error", err)

0 commit comments

Comments
 (0)