Releases: eclipse-paho/paho.mqtt.golang
v1.5.0
In the year since the release of v1.4.3 the majority of changes have been small incremental improvements/fixes. One notable change is that Go v1.20+ is now required (due to PR #646).
What's Changed
- Wrap connection network errors by @adriansmares in #646
- Clarify use of token.WaitTimeout by @MattBrittan in #659
- fix (#661): Add NewClientOptionsReader for mocking purposes. by @avmunm in #662
- fix: fix keep-alive timeouts on small intervals by @lefinal in #667
- Replace the time.After with the timer for efficiency. by @DVasselli in #671
- fix: deprecation warnings for ioutil by @vruge in #665
- fix: issue 675:goroutine leak when connectionUp(true) return error by @kiqi007 in #678
- Update dependencies by @MattBrittan in #683
New Contributors
- @adriansmares made their first contribution in #646
- @avmunm made their first contribution in #662
- @lefinal made their first contribution in #667
- @DVasselli made their first contribution in #671
- @vruge made their first contribution in #665
- @kiqi007 made their first contribution in #678
Full Changelog: v1.4.3...v1.5.0
v1.4.3
Release 1.4.3 is a relatively small release to bring in changes made in the eight months since 1.4.2.
Thanks to everyone who submitted issues and contributed code (list of the main merged pull requests below):
What's Changed
- Avoid Panic when keepalive is 1 by @tomatod in #622
- Allow MQTT username/password in websocket URI @MattBrittan in #624
- Add backoff when reconnecting following immediate connection loss @tomatod in #625
- Update dependencies (github.com/gorilla/[email protected], golang.org/x/net, golang.org/x/sync) and specify
go 1.18
ingo.mod
.
Full Changelog: v1.4.2...v1.4.3
v1.4.2
Release 1.4.2 is relatively small and is mostly focused on tidying up the way the library manages the connection status. Previously sync/ atomic
was used to read/update the status but this led to a range of potential deadlocks, and workarounds to avoid these, which made the code difficult to follow. The new connectionStatus separates status handling from client
and should simplify further development whilst resolving potential race conditions. It is my hope that users will not notice any change (@master was updated on 10th August and the updated code has been running in production at a few sites since then without issue).
A further change is that it is now possible to disable auto acknowledgment so that received messages can be manually acknowledged (or, more to the point, not acknowledged!).
Thanks to everyone who submitted issues and contributed code (list of the main merged pull requests below):
What's Changed
- Tidy up use of mutex in
messageIds
by @MattBrittan in #602 - Resolve situation where broker accepted connection but did not respond to CONNECT packet in a timely manner (should be very unusual but was reported in #597). @MattBrittan in #603
- Resolve race condition in test by @MattBrittan in #606
- Re-architect status handling by @MattBrittan in #607
- Enable manual ACK by @shivamkm07 in #578
New Contributors
- @shivamkm07 made their first contribution in #578
Full Changelog: v1.4.1...v1.4.2
v1.4.1
The license update in v1.4.0 included changes which prevented https://pkg.go.dev from displaying the documentation. The only change in this release is to update LICENSE such that it includes the full test of the Eclipse Public License v2.0 (tested this on a fork and it appears to resolve the issue).
v1.4.0
In the year since the release of v1.3.5 the majority of changes have been small incremental improvements/fixes. It is worth noting that the library has moved to the EPL v2.0 license (faq).
A few new features have been added:
- Managing the connection to the broker can become involved (e.g. setting unusual TCP/TLS options, need for a non-standard TLS library, require a specific web-socket library etc) and the library already has too many options! To address this a new option,
SetCustomOpenConectionFn
, has been added that enables users to provide a function (func(uri *url.URL, options ClientOptions) (net.Conn, error)
) that will be called to establish a connection (replacing the inbuilt code). This should enable edge cases to be addressed without the need for further changes to this library. - When connecting/reconnecting it is possible that there will be a lot of packets queued; in the past the library sent all of these packets as rapidly as possible when the connection came up. However this could saturate some network links causing the connection to drop (a vicious circle). The new option
SetMaxResumePubInFlight
allows a limit to be imposed; the library will send out the requested number of packets and then wait for acknowledgements before sending more (only applicable at QOS1+).
Thanks to everyone who submitted issues and contributed code (list of the main merged pull requests below):
What's Changed
- SetMaxResumePubInFlight option - limit inflight publish packets on resume by @MattBrittan in #521
- Test for PR 521 (forgot to commit) by @MattBrittan in #522
- Dont panic if there are files with short names in the file store folder. by @MattBrittan in #523
- Add license headers to all files and move from EPL v1.0 to EPL v2.0 by @MattBrittan in #524 / #525
- Add warning to Disconnect function by @MattBrittan in #537
- Use uri.Path instead of uri.Host for UNIX domain socket URLs by @webconn in #540
- CodeQL & integer conversion fix by @jfcg in #541
- Mosquitto related changes (updated config and comments). by @MattBrittan in #546
- README enhancements by @MattBrittan in #547 / #548
- Improve handling of SUBSCRIBE/UNSUBSCRIBE over disconnect/reconnect. by @MattBrittan in #557
- log err.error() if ConnectRetry is enabled by @TomasVojacek in #558
- Add tcp option to set keep alive value on the tcp layer by @mogaleaf in #561
- Document token.Wait behaviour during reconnect by @ecksun in #565
- Custom open connection for different network types by @GilGil1 in #574 / #575
- nil c.options.Dialer caused a panic. by @MattBrittan in #577
- Disconnect refactor by @ptsneves in #586
- client.go Remove Disconnect()'s wait on c.commsStopped. by @ptsneves in #590
New Contributors
- @webconn made their first contribution in #540
- @jfcg made their first contribution in #541
- @TomasVojacek made their first contribution in #558
- @mogaleaf made their first contribution in #561
- @ecksun made their first contribution in #565
- @GilGil1 made their first contribution in #574
- @ptsneves made their first contribution in #586
Full Changelog: v1.3.5...v1.4.0
v1.3.5
This is a minor release that resolves two serious, but rarely experienced, issues:
#508 Resolve send on closed channel when order=false and connection closed - @MattBrittan (thanks to @thomas-tacquet for raising this issue and suggesting a solution #504 )
#512 Resolve rare deadlock caused by loss of connection (in particular circumstances) - @MattBrittan (thanks to @dehort for raising #509 and providing the detailed logging needed to trace this)
v1.3.4
This is a minor release that improves support for proxies, removes passwords from the logs, and resolves a potential deadlock in Disconnect()
.
#497 Provides a callback (c.options.OnConnectAttempt
) on connection allowing per attempt tls details; improves proxy support - @amir-khassaia
#500 Redact password in Stringer of packets.ConnectPacket - @besedad
#502 Handle connection loss during call to Disconnect() - @MattBrittan
v1.3.3
This is a minor release that adds support for websocket proxies, resolves a potential panic, and sets the DUP flag when resenting PUBLISH packets.
#431 Add Proxy to WebsocketOptions (also logs status if connection fails) - @fulder
#489 If options.AutoReconnect is true calling Disconnect may trigger panic - @MattBrittan
#490 When resending QOS 1+ PUBLISH packets the DUP flag should be set - @MattBrittan
v1.3.2
This is a minor release that resolves a reported issue (#479 & #469) that broke connections to AWS IoT over WSS. Fixing this involved reversing PR #319 which may break some specific IPV6 use-cases (if this impacts this you will need to update your code to pass in an address that complies with RFC3986/RFC6874; i.e. escape % chars in the zone identifier).
- Export connection refused errors outside of the map - @umeat
- Remove changes introduced in PR #319 (escaping % in server string) - @MattBrittan
- Documentation / sample code updates - @MattBrittan
v1.3.1
This is a minor release that resolves a reported issue that could lead to a deadlock when shutting down following a loss of connection (thanks to @williamshaocharles for reporting this and providing logs).