server

The fully compliant, embeddable high-performance Go MQTT v5 server for IoT, smarthome, and pubsub

MIT License

Stars
794
Committers
39

Bot releases are visible (Hide)

server - v2.6.5 Latest Release

Published by mochi-co 3 months ago

What's Changed

New Contributors

🥳

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.6.4...v2.6.5

server - v2.6.4

Published by mochi-co 5 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.6.3...v2.6.4

server - v2.6.3

Published by mochi-co 6 months ago

What's Changed

Lots of good updates, with many thanks to @dgduncan @werbenhu @thedevop!

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.6.2...v2.6.3

server - v2.6.2

Published by mochi-co 6 months ago

What's Changed

Thank you @thedevop and @werbenhu !

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.6.1...v2.6.2

server - v2.6.1

Published by mochi-co 7 months ago

What's Changed

Thank you @werbenhu !

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.6.0...v2.6.1

server - v2.6.0

Published by mochi-co 7 months ago

What's Changed

Be advised - this release includes a breaking change for the Docker image which may be fixed in the future.

File Based Configuration

You can use File Based Configuration with either the Docker image (noted above), or by running the build binary with the --config=config.yaml or --config=config.json parameter.

Configuration files provide a convenient mechanism for easily preparing a server with the most common configurations. You can enable and configure built-in hooks and listeners, and specify server options and compatibilities:

listeners:
  - type: "tcp"
    id: "tcp12"
    address: ":1883"
  - type: "ws"
    id: "ws1"
    address: ":1882"
  - type: "sysinfo"
    id: "stats"
    address: ":1880"
hooks:
  auth:
    allow_all: true
options:
  inline_client: true

Please review the examples found in examples/config for all available configuration options.

There are a few conditions to note:

  1. If you use file-based configuration, you can only have one of each hook type.
  2. You can only use built in hooks with file-based configuration, as the type and configuration structure needs to be known by the server in order for it to be applied.
  3. You can only use built in listeners, for the reasons above.

If you need to implement custom hooks or listeners, please do so using the traditional manner indicated in cmd/main.go.

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.4.6...v2.6.0

server - v2.4.6

Published by mochi-co 9 months ago

What's Changed

Many thanks @thedevop!

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.4.5...v2.4.6

server - v2.4.5

Published by mochi-co 9 months ago

What's Changed

A couple of small improvements, thank you @werbenhu and @thedevop! 🙂

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.4.4...v2.4.5

server - v2.4.4

Published by mochi-co 10 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.4.3...v2.4.4

server - v2.4.3

Published by mochi-co 10 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.4.2...v2.4.3

server - v2.4.2

Published by mochi-co 11 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/mochi-mqtt/server/compare/v2.4.1...v2.4.2

server - v2.4.1

Published by mochi-co about 1 year ago

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 https://github.com/mochi-mqtt/server/pull/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 https://github.com/mochi-mqtt/server/pull/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 https://github.com/mochi-mqtt/server/pull/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 https://github.com/mochi-mqtt/server/pull/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: https://github.com/mochi-mqtt/server/compare/v2.4.0...v2.4.1

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.4.0

Published by mochi-co about 1 year 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

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: https://github.com/mochi-mqtt/server/compare/v2.3.0...v2.4.0

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.3.0

Published by mochi-co about 1 year ago

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 https://github.com/mochi-mqtt/server/pull/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: https://github.com/mochi-mqtt/server/compare/v2.2.16...v2.3.0

server - v2.2.16

Published by mochi-co about 1 year ago

What's Changed

  • WriterSize parameter is incorrectly set by @wind-c in https://github.com/mochi-co/mqtt/pull/252
    • Fixes an issue where the WriterSize was being set with the ReaderSize value.
  • Ensure msg doesn't exceed subscription QoS by @thedevop in https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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 https://github.com/mochi-co/mqtt/pull/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, a packets.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.

This is the biggest release in a while, with many excellent contributions! Thank you everyone!

New Contributors

Full Changelog: https://github.com/mochi-co/mqtt/compare/v2.2.15...v2.2.16

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.2.15

Published by mochi-co over 1 year ago

What's Changed

  • Add OnSessionEstablish hook by @dgduncan in https://github.com/mochi-co/mqtt/pull/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: https://github.com/mochi-co/mqtt/compare/v2.2.14...v2.2.15

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.2.14

Published by mochi-co over 1 year ago

What's Changed

  • Fix ScanSubscribersTopicInheritanceBug by @thedevop in https://github.com/mochi-co/mqtt/pull/243, resolves issue #242 where subscribers to topic a/b were able to receive messages for topic a/b/c. Additionally allows case-insensitive share group prefixes.
  • Add healthcheck listener by @dgduncan in https://github.com/mochi-co/mqtt/pull/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: https://github.com/mochi-co/mqtt/compare/v2.2.13...v2.2.14

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.2.13

Published by mochi-co over 1 year ago

What's Changed

  • Add OnRetainPublished hook by @thedevop in https://github.com/mochi-co/mqtt/pull/237, which is called when a retained message is published to a client/subscriber.
  • Expose SendConnack, err return on OnConnect by @mochi-co in https://github.com/mochi-co/mqtt/pull/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 by server.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 or Server 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.

Full Changelog: https://github.com/mochi-co/mqtt/compare/v2.2.12...v2.2.13

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.2.12

Published by mochi-co over 1 year ago

What's Changed

  • Add retainMessage to LWT to properly handle message retention by @dgduncan in https://github.com/mochi-co/mqtt/pull/234
    • Fixes and issue (#153, #233) where the retain flag was not being honoured in will messages.

New Contributors

Full Changelog: https://github.com/mochi-co/mqtt/compare/v2.2.11...v2.2.12

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing
server - v2.2.11

Published by mochi-co over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/mochi-co/mqtt/compare/v2.2.10...v2.2.11

Tests

  • Builds
  • Unit Tests Passing
  • Paho Interoperability Passing