Class Mqtt5Listener

  • All Implemented Interfaces:
    AutoCloseable

    public class Mqtt5Listener
    extends CrtResource
    This class wraps the aws-c-mqtt MQTT5 client to provide the basic MQTT5 pub/sub functionalities via the AWS Common Runtime One Mqtt5Listener class creates one connection. MQTT5 support is currently in developer preview. We encourage feedback at all times, but feedback during the preview window is especially valuable in shaping the final product. During the preview period we may make backwards-incompatible changes to the public API, but in general, this is something we will try our best to avoid.
    • Constructor Detail

      • Mqtt5Listener

        public Mqtt5Listener​(Mqtt5ListenerOptions options,
                             Mqtt5Client client)
                      throws CrtRuntimeException
        Creates a Mqtt5Listener instance using the provided Mqtt5ListenerOptions. Once the Mqtt5Listener is created, changing the settings will not cause a change in already created Mqtt5Listener's.
        Parameters:
        options - The Mqtt5ListenerOptions class to use to configure the new Mqtt5Listener.
        client - The Mqtt5Client class the mqtt5 listener listen to
        Throws:
        CrtRuntimeException - If the system is unable to allocate space for a native MQTT5 client structure
    • Method Detail

      • releaseNativeHandle

        protected void releaseNativeHandle()
        Cleans up the native resources associated with this client. The client is unusable after this call
        Specified by:
        releaseNativeHandle in class CrtResource
      • canReleaseReferencesImmediately

        protected boolean canReleaseReferencesImmediately()
        Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits. Resources that wait are responsible for calling releaseReferences() manually.
        Specified by:
        canReleaseReferencesImmediately in class CrtResource
        Returns:
        true if this resource releases synchronously, false if this resource performs async shutdown