Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/browser/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @mergeTarget
*/

import type { Mqtt5Client } from "./mqtt5";
import * as mqtt from "mqtt";
import * as WebsocketUtils from "./ws";
import * as auth from "./auth";
Expand Down Expand Up @@ -203,6 +204,11 @@ export interface MqttConnectionConfig {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
Copy link
Contributor

@bretambrose bretambrose Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we can shorten this along the lines of

"Use {@link Mqtt5Client} to access a more robust feature set, clearer error handling, and lifetime
management. More details can be found at [link]". Any other further details should be in the link and not on the repeated doc comments.

* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* MQTT client
*
* @category MQTT
Expand Down
36 changes: 36 additions & 0 deletions lib/native/aws_iot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as platform from '../common/platform';
import { HttpProxyOptions } from "./http";
import { WebsocketOptionsBase } from "../common/auth";
import { CrtError } from "./error";
import type { Mqtt5Client } from "./mqtt5";

import {
aws_sign_request,
Expand Down Expand Up @@ -50,6 +51,11 @@ export interface WebsocketConfig extends WebsocketOptionsBase{
}

/**
* @deprecated Please use {@link Mqtt5Client}
* The MQTT 3.1.1 client remains fully supported, but migrating to
* MQTT 5 gives you a richer feature set, clearer error handling, and
* improved lifetime management.
*
* Builder functions to create a {@link MqttConnectionConfig} which can then be used to create
* a {@link MqttClientConnection}, configured for use with AWS IoT.
*
Expand Down Expand Up @@ -79,6 +85,11 @@ export class AwsIotMqttConnectionConfigBuilder {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* Create a new builder with mTLS file paths
* @param cert_path - Path to certificate, in PEM format
* @param key_path - Path to private key, in PEM format
Expand All @@ -95,6 +106,11 @@ export class AwsIotMqttConnectionConfigBuilder {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* Create a new builder with mTLS cert pair in memory
* @param cert - Certificate, in PEM format
* @param private_key - Private key, in PEM format
Expand All @@ -111,6 +127,11 @@ export class AwsIotMqttConnectionConfigBuilder {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* Create a new builder with mTLS using a PKCS#11 library for private key operations.
*
* NOTE: This configuration only works on Unix devices.
Expand All @@ -128,6 +149,11 @@ export class AwsIotMqttConnectionConfigBuilder {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* Create a new builder with mTLS using a PKCS#12 file for private key operations.
*
* Note: This configuration only works on MacOS devices.
Expand All @@ -147,6 +173,11 @@ export class AwsIotMqttConnectionConfigBuilder {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* Create a new builder with mTLS using a certificate in a Windows certificate store.
*
* NOTE: This configuration only works on Windows devices.
Expand All @@ -166,6 +197,11 @@ export class AwsIotMqttConnectionConfigBuilder {
}

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* Creates a new builder with default Tls options. This requires setting the connection details manually.
*/
static new_default_builder() {
Expand Down
6 changes: 6 additions & 0 deletions lib/native/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @mergeTarget
*/

import type { Mqtt5Client } from "./mqtt5";
import crt_native from './binding';
import { NativeResource, NativeResourceMixin } from "./native_resource";
import { BufferedEventEmitter } from '../common/event';
Expand Down Expand Up @@ -96,6 +97,11 @@ export type MqttConnectionFailure = (callback_data: OnConnectionFailedResult) =>
export type MqttConnectionClosed = (callback_data: OnConnectionClosedResult) => void;

/**
* @deprecated We strongly recommend using {@link Mqtt5Client}.
* There are no current plans to fully deprecate the MQTT 3.1.1 client but it is highly recommended customers
* migrate to the MQTT5 client to access a more robust feature set, clearer error handling, and lifetime
* management. More details can be found in the GitHub Repo FAQ
*
* MQTT client
*
* @category MQTT
Expand Down
Loading