Class MqttRequestResponseClient

java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.iot.MqttRequestResponseClient
All Implemented Interfaces:
AutoCloseable

public class MqttRequestResponseClient extends CrtResource
A helper class for AWS service clients that use MQTT as the transport protocol. The class supports orchestrating request-response operations and creating streaming operations. Used by the IoT SDKs to implement higher-level service clients that provide a good user experience. Not intended to be constructed or used directly; the service client will create one during its construction.
  • Constructor Details

    • MqttRequestResponseClient

      public MqttRequestResponseClient(Mqtt5Client client, MqttRequestResponseClientOptions options)
      MQTT5-based constructor for request-response service clients
      Parameters:
      client - MQTT5 client that the request-response client should use as transport
      options - request-response client configuration options
    • MqttRequestResponseClient

      public MqttRequestResponseClient(MqttClientConnection client, MqttRequestResponseClientOptions options)
      MQTT311-based constructor for request-response service clients
      Parameters:
      client - MQTT311 client that the request-response client should use as transport
      options - request-response client configuration options
  • Method Details

    • submitRequest

      Submits a request to the request-response client.
      Parameters:
      request - description of the request to perform
      Returns:
      future that completes with the result of performing the request
    • createStream

      public StreamingOperation createStream(StreamingOperationOptions options)
      Creates a new streaming operation from a set of configuration options. A streaming operation provides a mechanism for listening to a specific event stream from an AWS MQTT-based service.
      Parameters:
      options - configuration options for the streaming operation
      Returns:
      a new streaming operation instance
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class CrtResource