fix: stabilize yutong mqtt ingestion
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user