Class MqttRequestResponseResult


  • public final class MqttRequestResponseResult
    extends OperationResult
    Result of one high-level MQTT 5 request/response operation.

    The result keeps the request topic, response topic, correlation data and the received response message together. Correlation Data is copied at public boundaries because it is binary application-owned state and is often reused as an identifier in request maps or logs.

    • Method Detail

      • getRequestTopic

        public String getRequestTopic()
        Returns the Topic Name used for the request PUBLISH.
        Returns:
        request Topic Name
      • getResponseTopic

        public String getResponseTopic()
        Returns the MQTT 5 Response Topic advertised on the request.
        Returns:
        response Topic Name
      • getCorrelationData

        public byte[] getCorrelationData()
        Returns the Correlation Data used to match the response.
        Returns:
        defensive copy of the correlation data, or null when the request was sent without Correlation Data
      • getResponse

        public MqttMessage getResponse()
        Returns the matching response message.
        Returns:
        high-level response message view, or null if the operation failed before a matching response arrived