Skip to content

Commit

Permalink
feat: set MQTT client OnConnect before connect to broker (#1556)
Browse files Browse the repository at this point in the history
Signed-off-by: Jieke Choo <jiekechoo@yiqisoft.cn>
  • Loading branch information
jiekechoo authored Mar 9, 2024
1 parent de3242a commit 0cd0c2f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/transforms/mqttsecret.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,10 @@ func (sender *MQTTSecretSender) ConnectToBroker(lc logger.LoggingClient, sp boot
sender.preConnected = true
}
}

// SetOnConnect sets the OnConnect Handler before client is connected so client can be captured.
func (sender *MQTTSecretSender) SetOnConnectHandler(onConnect MQTT.OnConnectHandler) {

sender.opts.SetOnConnectHandler(onConnect)

}

0 comments on commit 0cd0c2f

Please sign in to comment.