Class AwsIotMqtt5ClientConfigBuilder

Builder pattern class to create an Mqtt5ClientConfig which can then be used to create an Mqtt5Client, configured for use with AWS IoT.

MQTT5 Client User Guide

Hierarchy

  • AwsIotMqtt5ClientConfigBuilder

Methods

  • Overrides the default system trust store.

    Parameters

    • Optional caDirpath: string

      Only used on Unix-style systems where all trust anchors are stored in a directory (e.g. /etc/ssl/certs).

    • Optional caFilepath: string

      Single file containing all trust CAs, in PEM format

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides the time interval to wait after sending a CONNECT request for a CONNACK to arrive. If one does not arrive, the connection will be shut down.

    Parameters

    • Optional connackTimeoutMs: number

      time interval to wait after sending a CONNECT request for a CONNACK to arrive

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides all configurable options with respect to the CONNECT packet sent by the client, including the will. These connect properties will be used for every connection attempt made by the client. Custom authentication configuration will override the username and password values in this configuration.

    Parameters

    • connectPacket: ConnectPacket

      all configurable options with respect to the CONNECT packet sent by the client

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides the maximum amount of time to wait to reconnect after a disconnect. Exponential backoff is performed with controllable jitter after each connection failure.

    Parameters

    • Optional maxReconnectDelayMs: number

      maximum amount of time to wait to reconnect after a disconnect.

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides the amount of time that must elapse with an established connection before the reconnect delay is reset to the minimum. This helps alleviate bandwidth-waste in fast reconnect cycles due to permission failures on operations.

    Parameters

    • Optional minConnectedTimeToResetReconnectDelayMs: number

      the amount of time that must elapse with an established connection before the reconnect delay is reset to the minimum

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides the minimum amount of time to wait to reconnect after a disconnect. Exponential backoff is performed with controllable jitter after each connection failure.

    Parameters

    • Optional minReconnectDelayMs: number

      minimum amount of time to wait to reconnect after a disconnect.

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides how the reconnect delay is modified in order to smooth out the distribution of reconnection attempt timepoints for a large set of reconnecting clients.

    Parameters

    • retryJitterMode: RetryJitterType

      controls how the reconnect delay is modified in order to smooth out the distribution of econnection attempt timepoints for a large set of reconnecting clients.

    Returns AwsIotMqtt5ClientConfigBuilder

  • Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS using in-memory X509 certificate and key.

    Parameters

    • hostName: string

      AWS IoT endpoint to connect to

    • cert: string

      Certificate, in PEM format

    • privateKey: string

      Private key, in PEM format

    Returns AwsIotMqtt5ClientConfigBuilder

  • Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS using X509 certificate and key at the supplied file paths.

    Parameters

    • hostName: string

      AWS IoT endpoint to connect to

    • certPath: string

      Path to certificate, in PEM format

    • keyPath: string

      Path to private key, in PEM format

    Returns AwsIotMqtt5ClientConfigBuilder

  • Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS using a PKCS11 library for certificate and private key operations.

    NOTE: This configuration only works on Unix devices.

    Parameters

    • hostName: string

      AWS IoT endpoint to connect to

    • pkcs11Options: Pkcs11Options

      PKCS#11 options.

    Returns AwsIotMqtt5ClientConfigBuilder

  • Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS using a PKCS12 file.

    Note: This configuration only works on MacOS devices.

    Parameters

    • hostName: string

      AWS IoT endpoint to connect to

    • pkcs12_options: Pkcs12Options

      The PKCS#12 options to use in the builder.

    Returns AwsIotMqtt5ClientConfigBuilder

  • Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via mutual TLS using a certificate entry in a Windows certificate store.

    NOTE: This configuration only works on Windows devices.

    Parameters

    • hostName: string

      AWS IoT endpoint to connect to

    • certificatePath: string

      Path to certificate in a Windows certificate store. The path must use backslashes and end with the certificate's thumbprint. Example: CurrentUser\MY\A11F8A9B5DF5B98BA3508FBCA575D09570E0D2C6

    Returns AwsIotMqtt5ClientConfigBuilder

  • Create a new MQTT5 client builder that will create MQTT5 clients that connect to AWS IoT Core via websockets, using AWS Sigv4 signing to establish authenticate.

    Parameters

    • hostName: string

      AWS IoT endpoint to connect to

    • Optional options: WebsocketSigv4Config

      additional sigv4-oriented options to use

    Returns AwsIotMqtt5ClientConfigBuilder

Node-only

  • Overrides the time interval to wait for an ack after sending a QoS 1+ PUBLISH, SUBSCRIBE, or UNSUBSCRIBE before failing the operation. Defaults to no timeout.

    Parameters

    • Optional ackTimeoutSeconds: number

      the time interval to wait for an ack after sending a QoS 1+ PUBLISH, SUBSCRIBE, or UNSUBSCRIBE before failing the operation

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides additional controls for client behavior with respect to operation validation and flow control; these checks go beyond the base MQTT5 spec to respect limits of specific MQTT brokers.

    Parameters

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides how disconnects affect the queued and in-progress operations tracked by the client. Also controls how new operations are handled while the client is not connected. In particular, if the client is not connected, then any operation that would be failed on disconnect (according to these rules) will also be rejected.

    Parameters

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides the time interval to wait after sending a PINGREQ for a PINGRESP to arrive. If one does not arrive, the client will close the current connection.

    Parameters

    • Optional pingTimeoutMs: number

      time interval to wait after sending a PINGREQ for a PINGRESP to arrive

    Returns AwsIotMqtt5ClientConfigBuilder

  • Overrides the socket properties of the underlying MQTT connections made by the client. Leave undefined to use defaults (no TCP keep alive, 10 second socket timeout).

    Parameters

    • socketOptions: SocketOptions

      socket properties of the underlying MQTT connections made by the client

    Returns AwsIotMqtt5ClientConfigBuilder

Generated using TypeDoc