Class Mqtt5ClientOptions


  • public class Mqtt5ClientOptions
    extends java.lang.Object
    Configuration for the creation of Mqtt5Clients
    • Constructor Detail

      • Mqtt5ClientOptions

        public Mqtt5ClientOptions​(Mqtt5ClientOptions.Mqtt5ClientOptionsBuilder builder)
        Creates a Mqtt5ClientOptionsBuilder instance
        Parameters:
        builder - The builder to get the Mqtt5ClientOptions values from
    • Method Detail

      • getHostName

        public java.lang.String getHostName()
        Returns the host name of the MQTT server to connect to.
        Returns:
        Host name of the MQTT server to connect to.
      • getPort

        public java.lang.Long getPort()
        Returns the network port of the MQTT server to connect to.
        Returns:
        Network port of the MQTT server to connect to.
      • getBootstrap

        public ClientBootstrap getBootstrap()
        Returns the Client bootstrap used.
        Returns:
        The Client bootstrap used
      • getSocketOptions

        public SocketOptions getSocketOptions()
        Returns the socket properties of the underlying MQTT connections made by the client.
        Returns:
        the socket properties of the underlying MQTT connections made by the client or null if defaults are used.
      • getTlsContext

        public TlsContext getTlsContext()
        Returns the TLS context for secure socket connections. If null, then a plaintext connection will be used.
        Returns:
        TLS context for secure socket connections.
      • getHttpProxyOptions

        public HttpProxyOptions getHttpProxyOptions()
        Returns the (tunneling) HTTP proxy usage when establishing MQTT connections
        Returns:
        (tunneling) HTTP proxy usage when establishing MQTT connections
      • getConnectOptions

        public ConnectPacket getConnectOptions()
        Returns 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.
        Returns:
        all configurable options with respect to the CONNECT packet sent by the client, including the will
      • getSessionBehavior

        public Mqtt5ClientOptions.ClientSessionBehavior getSessionBehavior()
        Returns how the Mqtt5Client should behave with respect to MQTT sessions.
        Returns:
        How the Mqtt5Client should behave with respect to MQTT sessions.
      • getExtendedValidationAndFlowControlOptions

        public Mqtt5ClientOptions.ExtendedValidationAndFlowControlOptions getExtendedValidationAndFlowControlOptions()
        Returns the 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.
        Returns:
        The additional controls for client behavior with respect to operation validation and flow control
      • getOfflineQueueBehavior

        public Mqtt5ClientOptions.ClientOfflineQueueBehavior getOfflineQueueBehavior()
        Returns 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.
        Returns:
        How disconnects affect the queued and in-progress operations tracked by the client.
      • getRetryJitterMode

        public ExponentialBackoffRetryOptions.JitterMode getRetryJitterMode()
        Returns how the reconnect delay is modified in order to smooth out the distribution of reconnection attempt time points for a large set of reconnecting clients.
        Returns:
        how the reconnect delay is modified in order to smooth out the distribution of reconnection attempt time points for a large set of reconnecting clients.
      • getMinReconnectDelayMs

        public java.lang.Long getMinReconnectDelayMs()
        Returns the minimum amount of time to wait to reconnect after a disconnect. Exponential back-off is performed with jitter after each connection failure.
        Returns:
        The minimum amount of time to wait to reconnect after a disconnect.
      • getMaxReconnectDelayMs

        public java.lang.Long getMaxReconnectDelayMs()
        Returns the maximum amount of time to wait to reconnect after a disconnect. Exponential back-off is performed with jitter after each connection failure.
        Returns:
        The maximum amount of time to wait to reconnect after a disconnect
      • getMinConnectedTimeToResetReconnectDelayMs

        public java.lang.Long getMinConnectedTimeToResetReconnectDelayMs()
        Returns 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.
        Returns:
        The amount of time that must elapse with an established connection before the reconnect delay is reset to the minimum
      • getPingTimeoutMs

        public java.lang.Long getPingTimeoutMs()
        Returns 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.
        Returns:
        time interval to wait after sending a PINGREQ for a PINGRESP to arrive.
      • getConnackTimeoutMs

        public java.lang.Long getConnackTimeoutMs()
        Returns 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.
        Returns:
        Time interval to wait after sending a CONNECT request for a CONNACK to arrive
      • getAckTimeoutSeconds

        public java.lang.Long getAckTimeoutSeconds()
        Returns the time interval to wait for an ack after sending a QoS 1+ PUBLISH, SUBSCRIBE, or UNSUBSCRIBE before failing the operation.
        Returns:
        the time interval to wait for an ack after sending a QoS 1+ PUBLISH, SUBSCRIBE, or UNSUBSCRIBE before failing the operation.
      • getLifecycleEvents

        public Mqtt5ClientOptions.LifecycleEvents getLifecycleEvents()
        Returns the LifecycleEvents interface that will be called when the client gets a LifecycleEvent.
        Returns:
        The LifecycleEvents interface that will be called when the client gets a LifecycleEvent
      • getWebsocketHandshakeTransform

        public java.util.function.Consumer<Mqtt5WebsocketHandshakeTransformArgs> getWebsocketHandshakeTransform()
        Returns the callback that allows a custom transformation of the HTTP request which acts as the websocket handshake. Websockets will be used if this is set to a valid transformation callback. To use websockets but not perform a transformation, just set this as a trivial completion callback. If null, the connection will be made with direct MQTT.
        Returns:
        The custom transformation of the HTTP request that acts as the websocket handshake or null.
      • getPublishEvents

        public Mqtt5ClientOptions.PublishEvents getPublishEvents()
        Returns the PublishEvents interface that will be called when the client gets a message.
        Returns:
        PublishEvents interface that will be called when the client gets a message.
      • getTopicAliasingOptions

        public TopicAliasingOptions getTopicAliasingOptions()
        Returns the topic aliasing options to be used by the client
        Returns:
        the topic aliasing options to be used by the client