diff --git a/fvt/docker/mosquitto.conf b/fvt/docker/mosquitto.conf index e5bb07c..0bee02b 100644 --- a/fvt/docker/mosquitto.conf +++ b/fvt/docker/mosquitto.conf @@ -1,11 +1,10 @@ user mosquitto allow_anonymous true -allow_duplicate_messages false connection_messages true log_dest stdout log_timestamp true log_type all persistence false -port 1883 +listener 1883 \ No newline at end of file diff --git a/options.go b/options.go index 21ba154..d7a24e4 100644 --- a/options.go +++ b/options.go @@ -58,6 +58,9 @@ type ConnectionAttemptHandler func(broker *url.URL, tlsCfg *tls.Config) *tls.Con // ClientOptions contains configurable options for an Client. Note that these should be set using the // relevant methods (e.g. AddBroker) rather than directly. See those functions for information on usage. +// WARNING: Create the below using NewClientOptions unless you have a compelling reason not to. It is easy +// to create a configuration with difficult to trace issues (e.g. Mosquitto 2.0.12+ will reject connections +// with KeepAlive=0 by default). type ClientOptions struct { Servers []*url.URL ClientID string @@ -74,7 +77,7 @@ type ClientOptions struct { ProtocolVersion uint protocolVersionExplicit bool TLSConfig *tls.Config - KeepAlive int64 + KeepAlive int64 // Warning: Some brokers may reject connections with Keepalive = 0. PingTimeout time.Duration ConnectTimeout time.Duration MaxReconnectInterval time.Duration