Skip to content

Upgrading guide

Volker Milbrandt edited this page Jan 21, 2021 · 30 revisions

From 3.0.10 to 3.0.11 or 3.0.12:

General:

  • Nothing special at the moment.

From 3.0.9 to 3.0.10 or 3.0.8:

General:

  • Argument logger removed from IMqttChannelAdapter MQTTnet.Adapter.CreateClientAdapter(IMqttClientOptions options, IMqttNetLogger logger). Create a constructor in your AdapterFactory and pass there the logger.
  • Pass the root logger to MQTTnet.Adapter.MqttChannelAdapter. For other use cases where you previously created an CreateChildLogger create a CreateScopedLogger.

From 3.0.8 to 3.0.9:

General:

  • Replace MQTTnet.Diagnostics.IMqttNetChildLoggerwith MQTTnet.Diagnostics.IMqttNetLogger.
  • Replace MQTTnet.AspNetCore.ApplicationBuilderExtensions.SelectSubProtocol(requestedSubProtocolValues) with MQTTnet.AspNetCore.MqttSubProtocolSelector.SelectSubProtocol(requestedSubProtocolValues).
  • Class MQTTnet.AspNetCore.ApplicationBuilderExtensions is deprecated and will be removed in a future version.

From 3.0.6 to 3.0.7 or 3.0.8:

General:

  • Nothing special at the moment.

From 3.0.5 to 3.0.6:

General:

From 3.0.3 to 3.0.5:

General:

  • MqttConnectReturnCode is now deprecated, use MqttConnectReasonCode instead.
  • ConnectAsync has now a CancellationToken and can be used like this: await mqttClient.ConnectAsync(options, CancellationToken.None));

From 2.8.5 to 3.0.0:

General:

  • MqttProtocolVersion is now in the MQTTnet.Formatter namespace.
  • MqttFixedHeader, MqttPacketBodyReader, MqttPacketReader, MqttPacketWriter and MqttProtocolVersion are now in the MQTTnet.Formatter namespace.
  • IMqttPacketSerializer and MqttPacketSerializer do not exist anymore.

ManagedClient:

  • Updated async handlers:
private void Something()
{
    mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnAppMessage);
    mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnConnected);
    mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnDisconnected);
    mqttClient.ConnectingFailedHandler = new ConnectingFailedHandlerDelegate(OnConnectingFailed);
}

private async void OnAppMessage(MqttApplicationMessageReceivedEventArgs e)
{
}

private async void OnConnected(MqttClientConnectedEventArgs e)
{
}

private async void OnDisconnected(MqttClientDisconnectedEventArgs e)
{
}

private async void OnConnectingFailed(ManagedProcessFailedEventArgs e)
{
}

Client:

  • Updated async handlers:
private void Something()
{
    mqttClient.ApplicationMessageReceivedHandler = new MqttApplicationMessageReceivedHandlerDelegate(OnAppMessage);
    mqttClient.ConnectedHandler = new MqttClientConnectedHandlerDelegate(OnConnected);
    mqttClient.DisconnectedHandler = new MqttClientDisconnectedHandlerDelegate(OnDisconnected);
}

private async void OnAppMessage(MqttApplicationMessageReceivedEventArgs e)
{
}

private async void OnConnected(MqttClientConnectedEventArgs e)
{
}

private async void OnDisconnected(MqttClientDisconnectedEventArgs e)
{
}

From 2.7.5 to 3.x.x:

General:

Clone this wiki locally