github mochi-mqtt/server v2.4.0

latest releases: v2.6.5, v2.6.4, v2.6.3...
12 months ago

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 setting Options.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

  • @xyzj made their first contribution in #287 🥳

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

Don't miss a new server release

NewReleases is sending notifications on new releases.