Package software.amazon.awssdk.crt.iot
Class MqttRequestResponseClient
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.iot.MqttRequestResponseClient
- All Implemented Interfaces:
AutoCloseable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
Constructor Summary
ConstructorsConstructorDescriptionMQTT311-based constructor for request-response service clientsMqttRequestResponseClient
(Mqtt5Client client, MqttRequestResponseClientOptions options) MQTT5-based constructor for request-response service clients -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
createStream
(StreamingOperationOptions options) Creates a new streaming operation from a set of configuration options.submitRequest
(RequestResponseOperation request) Submits a request to the request-response client.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
MqttRequestResponseClient
MQTT5-based constructor for request-response service clients- Parameters:
client
- MQTT5 client that the request-response client should use as transportoptions
- 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 transportoptions
- 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
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 interfaceAutoCloseable
- Overrides:
close
in classCrtResource
-