Skip to content

Releases: mochi-mqtt/server

v1.2.3

22 Jun 15:05
1ae0509
Compare
Choose a tag to compare

What's Changed

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

04 May 12:00
Compare
Choose a tag to compare

What's Changed

  • Add topic un-/subscribe events by @muXxer in #74
  • Extend onSubscribe, onUnsubscribe events signatures by @mochi-co
  • Add onSubscribe, onUnsubscribe examples by @mochi-co

New Contributors

Full Changelog: v1.2.1...v1.2.2

v1.2.1

19 Apr 08:09
b53774f
Compare
Choose a tag to compare

Fixes a panic in 32bit systems caused by a misaligned struct field in the pool.

What's Changed

New Contributors

Full Changelog: v1.2.0...v1.2.1

Tests

  • Builds
  • Unit Tests Passing
  • PAHO Interoperability Passing

v1.2.0

10 Apr 19:24
3a15cc3
Compare
Choose a tag to compare

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

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

30 Jan 10:43
Compare
Choose a tag to compare

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

26 Jan 21:05
Compare
Choose a tag to compare

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

24 Jan 18:51
Compare
Choose a tag to compare

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

  • OnConnect and OnDisconnect Event Hooks by @mochi-co in #18

Full Changelog: v1.0.4...v1.0.5

v1.0.4

17 Jan 10:15
51d6825
Compare
Choose a tag to compare

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 of for select case.
  • Fixes shadowing of err in TCP listener.

Checks:

  • All unit tests passing.
  • Paho interoperability tests passing.

What's Changed

  • Fixed some bugs, wish the project better and better by @ClarkQAQ in #15

New Contributors

Full Changelog: v1.0.3...v1.0.4

v1.0.3

14 Jan 17:42
994adea
Compare
Choose a tag to compare

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

10 Jan 23:53
Compare
Choose a tag to compare
  • Removes stray fmt.Println from bolt persistence adapter.
  • Removes unnecessary fmt import bolt persistence adapter.
  • Increments server version.

What's Changed

New Contributors

Full Changelog: v1.0.1...v1.0.2