Releases: mochi-mqtt/server
v1.2.3
What's Changed
- Add CleanSession and Username to events.Client struct by @mochi-co in #82 as per #81
- Expose tls.Config to Listeners by @mochi-co in #83 as per #79
- Goreport fixes by @mochi-co in #84
Full Changelog: v1.2.2...v1.2.3
This release deprecates the Listener config.TLS value and instead exposes a new field, config.TLSConfig which takes a *tls.Config value.
Previously the setting of TLS certificates was handled by the broker, using config.TLS. However, this is a limiting approach, as it prevents users from configuring the TLS as they wish. Instead, the config.TLS field is deprecated, and we expose a new field, config.TLSConfig, which takes the *tls.Config value directly.
Old:
err := server.AddListener(tcp, &listeners.Config{
Auth: new(auth.Allow),
TLS: &listeners.TLS{
Certificate: testCertificate,
PrivateKey: testPrivateKey,
},
})
New:
cert, err := tls.X509KeyPair(testCertificate, testPrivateKey)
tlsConfig := &tls.Config{
Certificates: []tls.Certificate{cert},
}
err = server.AddListener(tcp, &listeners.Config{
Auth: new(auth.Allow),
TLSConfig: tlsConfig,
})
v1.2.2
v1.2.1
Fixes a panic in 32bit systems caused by a misaligned struct field in the pool.
What's Changed
- fix-panic by @BoskyWSMFN in #72
New Contributors
- @BoskyWSMFN made their first contribution in #72
Full Changelog: v1.2.0...v1.2.1
Tests
- Builds
- Unit Tests Passing
- PAHO Interoperability Passing
v1.2.0
v1.2.0
contains various improvements to error handling, event hooks, bug fixes, and some Quality-of-Life improvements. This is the biggest single update since v1.0.0, and contains the most contributors yet! Thank you everyone! ❤️
What's Changed
- added redis persistence mode by @wind-c in #26
- Revert "added redis persistence mode" by @mochi-co in #27
- Support non-UTF8 payloads (per MQTT specification) by @jmacd in #29
- Move two WaitGroup.Add calls by @jmacd in #36
- Wrap packet errors with cause information by @jmacd in #39
- Add an OnError handler, report the reason for disconnects by @jmacd in #38
- Replace Travis with Github Actions by @mochi-co in #41
- Publish: Set the retain flag in the fixedheader by @stffabi in #42
- Subscribe: Only send retained messages if ACLs has allowed subscription to the topic by @stffabi in #46
- Two no-functional-change cleanups combined by @jmacd in #51
- typo by @soyoo in #58
- docker: add initial simple Dockerfile by @deadprogram in #57
- Events: Add OnProcessMessage event by @stffabi in #53
- Fix Inflight Persistence Key by @mochi-co in #62
- Add ErrRejectPacket to OnProcessMessage by @mochi-co in #63
- Configurable Server Options by @mochi-co in #61
- Release leakable client buffers by @mochi-co in #67
- Fix Store Retained Messages by @mochi-co in #68
- V1.2.0 by @mochi-co in #69
New Contributors
- @jmacd made their first contribution in #29
- @stffabi made their first contribution in #42
- @soyoo made their first contribution in #58
- @deadprogram made their first contribution in #57
Full Changelog: v1.1.1...v1.2.0
Testing
- All unit tests passing.
- PAHO Tests passing.
- Inovex MQTT-Stressor at parity with previous releases.
v1.1.1
In v1.1.0 we made changes to the alignment of several structs (particularly Buffer) in order to ensure the broker is compatible with 32bit systems. In the process we discovered that other structs were not aligned in an optimised manner. v1.1.1 aligns all structs to 8bit boundaries and ensures they are packed most efficiently.
This release also contains other minor fixes:
- Locks were being copied in the Inflight, Buffer structs. These are now passed by address where appropriate.
- The method signature for writer WriteTo implemented an int instead of int64. This has been corrected and references to the method updated.
- Small changes to comments for clarity.
Tested on 32 and 64 bit platforms:
- Paho interoperability tests pass.
- Multiple iterations of inovex mqtt-stresser succeed without issue.
- All unit tests pass.
go vet
now passes clearly.
What's Changed
Full Changelog: v1.1.0...v1.1.1
v1.1.0
Adds compatibility for 32bit systems.
In issue #17 we found that attempting to run the broker on 32bit systems resulted in invalid memory address errors due to the use of unaligned int64s and the sync.atomic package. This release contains fixes to allow the broker to run correctly on these systems.
With many thanks to @rkennedy:
- Where possible, atomic int64 fields are replaced with uint32 fields.
- New tests to check struct field alignment requirements.
- Fixes a race condition between atomic loads and stores using CompareAndSwap.
- Update tests to match new field types and function signatures.
Another release may be coming in the future to ensure all structs are 8bit aligned and refactored for optimal memory usage.
Checks against 64bit and 32bit builds:
- All unit tests passing.
- Paho interoperability tests passing.
- Inovex MQTT stresser
What's Changed
New Contributors
Full Changelog: v1.0.5...v1.1.0
v1.0.5
Adds OnConnect and OnDisconnect event hooks for monitoring connecting and disconnecting clients, and associated unit tests and examples.
server.Events.OnConnect
is called when a client successfully connects to the broker. The method receives the connect packet and the id and connection type for the client who connected.server.Events.OnDisconnect
is called when a client disconnects to the broker. If the client disconnected abnormally, the reason is indicated in the error parameter.
Checks:
- All unit tests passing.
- Paho interoperability tests passing.
What's Changed
Full Changelog: v1.0.4...v1.0.5
v1.0.4
This minor release includes a handful of small fixes from @ClarkQAQ (many thanks!). In particular:
- Websocket upgrader now always returns
true
when CheckOrigin is called. - Removes capitalization on websocket error message
Message type not binary
. - Updates the mock listener to use
for range
instead offor select case
. - Fixes shadowing of
err
in TCP listener.
Checks:
- All unit tests passing.
- Paho interoperability tests passing.
What's Changed
New Contributors
Full Changelog: v1.0.3...v1.0.4
v1.0.3
Adds a new AllowClients
field to the packet structure.
This field can be set during the OnMessage
event hook, allowing an embedding server to selectively deliver messages to one or more clients within one or more topics based on their client id. For example:
// Add OnMessage Event Hook
server.Events.OnMessage = func(cl events.Client, pk events.Packet) (pkx events.Packet, err error) {
pkx = pk
// Example of using AllowClients to selectively deliver/drop messages.
// Only a client with the id of `allowed-client` will received messages on the topic.
if pkx.TopicName == "a/b/restricted" {
pkx.AllowClients = []string{"allowed-client"} // slice of known client ids
}
return pkx, nil
}
If AllowClients is nil or not set, it is ignored and the message is delivered as normal.
All unit tests passing, paho compatibility tests passing
Includes small fixes for code clarity and test integrity:
- Use .systemInfo instead of .system for clarity in
internal/clients
- Add setupServerClients to inherit existing server instance in
server_test.go
(previously new clients generated a new server object, so system stats were not shared - this change ensures all test clients use the same server).
What's Changed
Full Changelog: v1.0.2...v1.0.3
v1.0.2
- Removes stray
fmt.Println
from bolt persistence adapter. - Removes unnecessary
fmt
import bolt persistence adapter. - Increments server version.
What's Changed
- Remove unnecessary println by @jphastings in #12
New Contributors
- @jphastings made their first contribution in #12
Full Changelog: v1.0.1...v1.0.2