MQTT 5 adds a lightweight request-response convention to publish-subscribe messaging. A requester includes a Response Topic and may include Correlation Data. A responder publishes to that topic and returns the same Correlation Data so the requester can associate the response with the request.

That association is useful for robot services, but it is not a transaction protocol. Matching bytes do not prove that a command committed, that only one responder acted, or that a physical motion occurred once.

## Two properties create the convention

Response Topic is a UTF-8 Topic Name carried as a PUBLISH property. Its presence identifies the Application Message as a request. It cannot contain wildcard characters. The broker forwards it unchanged to subscribers receiving the request.

Correlation Data is Binary Data chosen by the requester. The broker also forwards it unchanged. A responder should copy the same value into the PUBLISH sent to the Response Topic. Only the requesting and responding applications define its meaning.

The requester can therefore maintain a table from correlation value to pending operation. When a response arrives, it uses the bytes to select the waiting caller. MQTT does not interpret the value, allocate it, check uniqueness, or expire the pending call.

## Matching proves association, not completion

Suppose a fleet manager requests inspect station 4 with correlation value c-7842. A robot service responds on the supplied topic with accepted and the same value. The pair is associated, but accepted may mean only that validation passed and work entered a queue.

A second response might later report completed, failed, or cancelled. Applications need an explicit status model. Treating the first matching response as a durable commit can produce incorrect operator displays or duplicate follow-up work.

Correlation Data also cannot prove who generated a response. Authentication, topic authorization, payload integrity, and application identity are separate controls. If modification could cause application failure, the MQTT specification recommends protecting the correlation value with encryption or a hash as appropriate.

## Publish-subscribe can create several responders

More than one subscriber can receive a request Topic. Unless the application restricts routing, several services may respond with the same Correlation Data. The requester needs a policy for multiple responses: accept the first authenticated authority, collect a known set, or reject ambiguous results.

Shared subscriptions can distribute requests among group members, but they still do not create database transactions. A member can fail after accepting a message. QoS retransmission or Session recovery can also revisit protocol state while application work has already progressed.

Use an application operation ID inside the payload in addition to Correlation Data. The responder stores that ID with request parameters, decision, and outcome. On a duplicate request, it returns the recorded state or safely resumes rather than repeating physical action.

## Response Topic is routing data

The requester chooses a response topic that it is authorized to subscribe to. A response service publishes there; the broker does not automatically route a special response packet. Access controls should prevent another client from reading or injecting responses.

Avoid a unique permanent subscription for every request. A client can use one stable response topic and unique correlation values, or a bounded pool of response topics. Clean up pending entries on response, timeout, cancellation, disconnect, and application restart according to the product contract.

Response Topic and Correlation Data contribute bytes to the packet and must fit negotiated Maximum Packet Size. A broker may reject or omit packets that violate size or authorization rules, so the requester still needs timeout behavior.

## Design a robot operation exchange

Define request fields such as operation_id, target robot, command type, issued time, deadline, expected state version, and desired parameters. Include Response Topic and a random, unpredictable correlation value. The responder authenticates the requester, validates the deadline and state, then records the operation ID before acknowledging application acceptance.

Return structured states: rejected, accepted, running, completed, failed, or cancelled. Every response copies the Correlation Data and operation ID. The requester checks both, validates responder authority, and applies monotonic state-transition rules.

Separate transport acknowledgement from application outcome. PUBACK, PUBREC, and PUBCOMP report MQTT protocol progress. A matching application response reports only the status encoded by the responder. Neither alone proves physical completion; evidence may require controller feedback or process sensing.

## Test ambiguity and recovery

Send two concurrent requests on the same Request Topic and Response Topic with different correlation values. Deliver responses out of order and verify the correct callers wake. Duplicate a response and confirm the requester does not apply the state twice.

Run two responders and verify the multiple-response policy. Drop the requester's connection after the responder records an operation but before the response arrives. On retry with the same operation ID, confirm the responder returns recorded state instead of executing again.

Inject a response with correct Correlation Data but an unauthorized publisher, wrong operation ID, expired deadline, or impossible state transition. It must be rejected. Record request and response topics, correlation hash, operation ID, responder identity, timestamps, and state transitions without exposing sensitive correlation bytes.

Correlation Data is a precise association tool within MQTT 5 request-response messaging. It helps pair publications, but robot transaction semantics come from authenticated identities, operation records, explicit statuses, deadlines, and idempotent application logic.