fix: stabilize yutong mqtt ingestion

This commit is contained in:
lingniu
2026-07-02 01:01:33 +08:00
parent 6d1d0aa85e
commit 3ee1d6f52b
4 changed files with 27 additions and 4 deletions

View File

@@ -108,6 +108,8 @@ func (c *MQTTClient) buildOptions(ctx context.Context) (*mqtt.ClientOptions, err
SetAutoReconnect(true).
SetConnectRetry(true).
SetConnectRetryInterval(5 * time.Second).
SetResumeSubs(true).
SetOrderMatters(false).
SetKeepAlive(keepAlive).
SetConnectTimeout(connectTimeout)

View File

@@ -111,6 +111,12 @@ func TestMQTTClientBuildOptionsLoadsTLSCertificates(t *testing.T) {
if !opts.CleanSession {
t.Fatal("CleanSession should be true")
}
if opts.Order {
t.Fatal("OrderMatters should be false so MQTT network handling is not blocked by Kafka/DB work")
}
if !opts.ResumeSubs {
t.Fatal("ResumeSubs should be true to avoid subscribe failures during reconnect churn")
}
if got := opts.KeepAlive; got != 20 {
t.Fatalf("KeepAlive = %d, want 20", got)
}