17. RPC over DDS ProΒΆ

Remote Procedure Calls (see RPC over DDS specification), also known as RPC, is a type of bidirectional communication, used in a request-reply pattern, that can be implemented using DDS entities such as DomainParticipants, Topics, DataWriters and DataReaders.

The RPC architecture is based on the client-server model: the client sends a request to the server, and the server sends one response (reply) back to the client.

The RPC specification provides two different APIs to build RPC over DDS applications:

  • A low-level request/reply API (see RPC over DDS Request-Reply API overview), which is based on the DDS API. Clients and Servers are modeled by a Requester or Replier entities, respectively, and created from a DomainParticipant.

    Each Requester and Replier contains a DataWriter and DataReader to send and receive samples. Requester sends request samples to the the Replier through a request topic, and the Replier, after processing the data and computing the result of the operation, sends reply samples back to the Requester through a different topic (reply topic).

    This API is intended to be used internally by the Fast DDS-Gen tool, so it is not recommended to be used directly by the user.

  • A high-level function-call style based API, built on top of the request/reply API, and generated automatically by the Fast DDS-Gen tool from an IDL file, containing an interface with the operations to be used by both client and server (see IDL interfaces ).

    This high level API is intended to be used to implement RPC applications with multiple data flows, including data streaming in both client and server sides, as described in RPC Data Streaming.

    Once the user declares the methods in the IDL file, Fast DDS-Gen generates the source code required to make remote invokations in a function-call, user-friendly style, and provides a source file to allow the user to implement the operations in the server side:

RPC over DDS API comparison