Skip to content

Commit

Permalink
fix: reuse session to receive data from subscriptions after reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddin-619 committed Apr 29, 2024
1 parent d3075c9 commit 759891c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/mqtt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func NewClient(o Options) (Client, error) {
opts.SetPingTimeout(60 * time.Second)
opts.SetKeepAlive(60 * time.Second)
opts.SetAutoReconnect(true)
opts.SetCleanSession(false)
opts.SetMaxReconnectInterval(10 * time.Second)
opts.SetConnectionLostHandler(func(c paho.Client, err error) {
log.DefaultLogger.Error("MQTT Connection lost", "error", err)
Expand Down

0 comments on commit 759891c

Please sign in to comment.