@@ -25,6 +25,7 @@ import {CrtError} from "./error";
2525export { HttpProxyOptions } from './http' ;
2626export * from "../common/mqtt5" ;
2727export * from '../common/mqtt5_packet' ;
28+ export { Mqtt5ClientConfigBase } from "../common/mqtt_shared" ;
2829
2930/**
3031 * Websocket handshake http request transformation function signature
@@ -123,59 +124,16 @@ export enum ClientExtendedValidationAndFlowControl {
123124/**
124125 * Configuration options for mqtt5 client creation.
125126 */
126- export interface Mqtt5ClientConfig {
127-
128- /**
129- * Host name of the MQTT server to connect to.
130- */
131- hostName : string ;
132-
133- /**
134- * Network port of the MQTT server to connect to.
135- */
136- port : number ;
137-
138- /**
139- * Controls how the MQTT5 client should behave with respect to MQTT sessions.
140- */
141- sessionBehavior ? : mqtt5 . ClientSessionBehavior ;
142-
143- /**
144- * Controls how the reconnect delay is modified in order to smooth out the distribution of reconnection attempt
145- * timepoints for a large set of reconnecting clients.
146- */
147- retryJitterMode ? : mqtt5 . RetryJitterType ;
148-
149- /**
150- * Minimum amount of time to wait to reconnect after a disconnect. Exponential backoff is performed with jitter
151- * after each connection failure.
152- */
153- minReconnectDelayMs ? : number ;
154-
155- /**
156- * Maximum amount of time to wait to reconnect after a disconnect. Exponential backoff is performed with jitter
157- * after each connection failure.
158- */
159- maxReconnectDelayMs ? : number ;
160-
161- /**
162- * Amount of time that must elapse with an established connection before the reconnect delay is reset to the minimum.
163- * This helps alleviate bandwidth-waste in fast reconnect cycles due to permission failures on operations.
164- */
165- minConnectedTimeToResetReconnectDelayMs ? : number ;
127+ export interface Mqtt5ClientConfig extends mqtt_shared . Mqtt5ClientConfigBase {
166128
167129 /**
168130 * Time interval to wait after sending a CONNECT request for a CONNACK to arrive. If one does not arrive, the
169131 * connection will be shut down.
132+ *
133+ * @group Node-only
170134 */
171135 connackTimeoutMs ? : number ;
172136
173- /**
174- * All configurable options with respect to the CONNECT packet sent by the client, including the will. These
175- * connect properties will be used for every connection attempt made by the client.
176- */
177- connectProperties ?: mqtt5_packet . ConnectPacket ;
178-
179137 /**
180138 * Controls how disconnects affect the queued and in-progress operations tracked by the client. Also controls
181139 * how new operations are handled while the client is not connected. In particular, if the client is not connected,
@@ -201,13 +159,6 @@ export interface Mqtt5ClientConfig {
201159 */
202160 ackTimeoutSeconds ? : number ;
203161
204- /**
205- * Additional controls for client behavior with respect to topic alias usage.
206- *
207- * If this setting is left undefined, then topic aliasing behavior will be disabled.
208- */
209- topicAliasingOptions ? : mqtt5 . TopicAliasingOptions
210-
211162 /**
212163 * Client bootstrap to use. In almost all cases, this can be left undefined.
213164 *
@@ -256,13 +207,12 @@ export interface Mqtt5ClientConfig {
256207 */
257208 extendedValidationAndFlowControlOptions ? : ClientExtendedValidationAndFlowControl ;
258209
259-
260210 /**
261- * Options for enable/ disable Aws IoT Metrics. The metrics includes SDK name, version, and platform.
262- *
211+ * Options for disable Aws IoT Metrics. The metrics includes SDK name, version, and platform.
212+ *
263213 * @group Node-only
264214 */
265- enableMetrics ? : boolean
215+ disableMetrics ? : boolean ;
266216}
267217
268218/**
@@ -300,7 +250,7 @@ export class Mqtt5Client extends NativeResourceMixin(BufferedEventEmitter) imple
300250 config . socketOptions ? config . socketOptions . native_handle ( ) : null ,
301251 config . tlsCtx ? config . tlsCtx . native_handle ( ) : null ,
302252 config . httpProxyOptions ? config . httpProxyOptions . create_native_handle ( ) : null ,
303- config . enableMetrics == false ? undefined : new mqtt_shared . AwsIoTDeviceSDKMetrics ( )
253+ config . disableMetrics == true ? undefined : new mqtt_shared . AwsIoTDeviceSDKMetrics ( )
304254 ) ) ;
305255 }
306256
0 commit comments