Releases: mochi-mqtt/server
v2.4.3
What's Changed
- Demo how to subscribe and publish directly within examples/hooks. by @werbenhu in #333
- Add a Japanese version of README.md by @heya-naohiro in #338
- Dynamically allocate write buffer if needed. (ready for merge) by @thedevop in #324
- Handle expired clients in server.loadClients(). by @werbenhu in #341
New Contributors
- @heya-naohiro made their first contribution in #338
Full Changelog: v2.4.2...v2.4.3
v2.4.2
What's Changed
- update README-CN.md by @werbenhu in #312
- Bump golang.org/x/net from 0.7.0 to 0.17.0 by @dependabot in #316
- Remove vendor folder by @mochi-co in #319
- Fix for unlimited maximum message expiry interval by @dadebue in #315
New Contributors
- @dadebue made their first contribution in #315
- @x20080406 made their first contribution in #321
Full Changelog: v2.4.1...v2.4.2
v2.4.1
The weeks got away from me a bit so this release is a little overdue, but better late than never and it contains some good, minor updates.
What's Changed
- Refactor Listener WG to track clients by @mochi-co in #301 resolves issue #298 in which hooks could shut down before all clients had gracefully concluded their runtime. The server will now wait until all clients have disconnected and their goroutines ended before proceeding from the listener shutdown stage to the hooks shutdown stage.
- Add some error logging in Listener.Serve(). by @werbenhu in #303 which adds some extra logging to help track down issues in listeners, should they occur.
- Add a Chinese version of README.md. by @werbenhu in #307 is an excellent initiative by @werbenhu to bring Mochi MQTT to a wider international audience.
- Emit warning if client keepalive is less than recommended minimum by @mochi-co in #305 attempts to address some recurring issues where developers noticed client connection instability while using very low keepalive values (#293). Now we show a warning if a client connects with an insufficient keepalive value.
Also lots of great work happening with feature roadmapping and project planning in https://github.com/orgs/mochi-mqtt/discussions - so have a look if you are interested to get involved! 🚀
Full Changelog: v2.4.0...v2.4.1
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing
v2.4.0
Breaking Changes
We've made things better, but we had to change things a bit to get there. There are two big changes in v2.4.0
:
Standard Logger
zerolog has been replaced with the new standard library log/slog. We will miss the colours, but this will be an important step towards ecosystem standardization.
You can read about the reasons and all the hard work that went into this change in #248. Huge thanks to @dgduncan in particular for driving this change forward.
Inline Subscribe/Unsubscribe
Inline Subscriptions were added. While you could previous use the server.Publish
method to directly publish messages into the broker, there was no way to receive them without creating a new client and connecting over the network. We've reworked the Inline Client
system so that you can now Subscribe
and Unsubscribe
from topic filters directly in the adjacent code - no client required.
In order to use
Publish
, you must now enabled the inline client by settingOptions.InlineClient: true
when creating your server:
server := mqtt.New(&mqtt.Options{
InlineClient: true,
})
You can learn more about how this works by reviewing the example in examples/direct/main.go, and on the README. You can read about the implementation process and discussions that surrounded this feature in #279 and #284. Again, massive thanks to @werbenhu for the work that went into this change, as well as @dgduncan and @thedevop for their thoughtful insights and code reviews.
What's Changed - Overall
- Use JSONeq to compare JSON by @wind-c in #267, which fixes the storage tests so they pass even if the JSON values are decoded in an arbitrary order.
- Fix readme example by @dgduncan in #276, updated the readme to have better examples for real-world usage.
- add aclcheck in publishToClient by @xyzj in #287, which resolves an issue where ACL was not respected when publishing to clients.
- Migrate from zerolog to slog by @dgduncan in #248, as noted above.
- Another code implementation for Inline Client Subscriptions by @werbenhu in #284, as noted above.
- Disconnect or return ack if unauthorized publish by @thedevop in #292, fixes issue #290 in which unauthorized publish packets were not being handled correctly for all MQTT versions.
- Small fixes and cleanups by @mochi-co in #295, which includes some general housekeeping, fixing comments, tests, and makes inline client methods an optional feature which is disabled by default.
New Contributors
Finally, a note of gratitude to everyone who has participated in this version, whether it is pull requests, code reviews, or just asking questions. Thank you!
Full Changelog: v2.3.0...v2.4.0
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing
v2.3.0
We have moved!
Mochi MQTT has become an organisation! 🥳
https://github.com/mochi-co/mqtt has moved to our new organisation: https://github.com/mochi-mqtt/server
See #271 for more information.
What's Changed
- Migrate imports, copyrights, etc by @mochi-co in #270
- All imports have been updated to the new organisation repo address.
- Copyright and licensing has been updated to cover mochi-mqtt organisation.
- Minor changes in readme paths and references.
Full Changelog: v2.2.16...v2.3.0
v2.2.16
What's Changed
- WriterSize parameter is incorrectly set by @wind-c in #252
- Fixes an issue where the WriterSize was being set with the ReaderSize value.
- Ensure msg doesn't exceed subscription QoS by @thedevop in #253
- Fixes an issue where publishes to clients weren't being correctly downgraded if the client had a lower QoS on their subscription.
- Fix websocket reads for packets > 1 buffer size by @ianrose14 in #260
- Fixes issue #259 in which the websocket listener failed if the packet received was over 2048 bytes.
- Retain flag should be delivered as false in v3 by @mochi-co in #257
- Fixes issue #251 in which the retain flag was being sent as false in MQTT v3 when issuing retains on subscribe.
- Preference Write, Read, Deny filters in ledger by @mochi-co in #262
- Fixes issue #258 in which ACL deny filters could be triggered before write and read filters.
- Do not retain messages if retain is not available by @mochi-co in #261
- Fixes issue #255 in which retain messages off was being advertised to the client but the functionality was not disabled on the server.
- method UnsubscribeClient's packet add fixedHeader by @kenuestar in #264
- Fixes an issue where packets being delivered to OnUnsubscribe were not indicated as unsubscribe packets.
- fix: data-race in badger hook by @gsagula in #266
- Fixes issue #256 in which data races occured in the badger storage example due to concurrent reads of the system info values.
- Allow Publish to return custom Ack error responses by @mochi-co in #256
- Fixes issue #249 in which the OnPublish hook was not able to signal the calling method to return an ack with a custom error.
packets.Code
errors can now be returned from OnPublish to issue an error ack. Additionally, apackets.CodeSuccessIgnore
response has been added, which will accept an incoming publish message and complete any QoS handshake, but will neither forward the incoming message to any subscribers nor retain it.
- Fixes issue #249 in which the OnPublish hook was not able to signal the calling method to return an ack with a custom error.
This is the biggest release in a while, with many excellent contributions! Thank you everyone!
New Contributors
- @ianrose14 made their first contribution in #260
- @kenuestar made their first contribution in #264
- @gsagula made their first contribution in #266
Full Changelog: v2.2.15...v2.2.16
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing
v2.2.15
What's Changed
- Add OnSessionEstablish hook by @dgduncan in #247 adds a new hook which is called immediately after a client connects, but before a session has been established and the Connack has been sent. This will allow persistent client data to be loaded on-the-fly rather than in a bulk load, and provides an interesting potentially superior implementation for future persistence patterns.
Full Changelog: v2.2.14...v2.2.15
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing
v2.2.14
What's Changed
- Fix ScanSubscribersTopicInheritanceBug by @thedevop in #243, resolves issue #242 where subscribers to topic
a/b
were able to receive messages for topica/b/c
. Additionally allows case-insensitive share group prefixes. - Add healthcheck listener by @dgduncan in #244, adding an http healthcheck endpoint for providing health monitoring status for cloud infrastructure, etc.
- Updated Contribution Guidelines in README.md, specifically relating to SPDX annotations:
SPDX Annotations are used to clearly indicate the license, copyright, and contributions of each file in a machine-readable format. If you are adding a new file to the repository, please ensure it has the following SPDX header:
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2022 mochi-co
// SPDX-FileContributor: Your name or alias <[email protected]>
package name
Please ensure to add a new SPDX-FileContributor
line for each contributor to the file. Refer to other files for examples. Please remember to do this, your contributions to this project are valuable and appreciated - it's important to receive credit!
You are requested to open a new PR adding your SPDX-FileContributor lines to the files where you have forgotten to do so!
Full Changelog: v2.2.13...v2.2.14
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing
v2.2.13
What's Changed
- Add OnRetainPublished hook by @thedevop in #237, which is called when a retained message is published to a client/subscriber.
- Expose SendConnack, err return on OnConnect by @mochi-co in #240, in order to support #236, in which developers need to be able to send custom connack messages and halt the connection process, a slightly breaking change was implemented;
- The OnConnect hook now returns an
error
type. This value is used byserver.attachClient
to halt the client connection process if the value is not nil. - The server.sendConnack method has been exported as SendConnack, and the signature has changed to take a properties parameter. This enables developers to issue a Connack with a custom reason code/string and v5 packet properties.
- When combined, this allows a developer to issue a Connack with a custom reason (such as
Use another server
orServer moved
), and packet properties (server address) from within OnConnect, and return a relevant packets.Code to halt the client connection. - Developers wishing to issue totally custom Connack packets may call
func (cl *Client) WritePacket(pk packets.Packet) error
from any hook.
- The OnConnect hook now returns an
Full Changelog: v2.2.12...v2.2.13
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing
v2.2.12
What's Changed
New Contributors
Full Changelog: v2.2.11...v2.2.12
Tests
- Builds
- Unit Tests Passing
- Paho Interoperability Passing