A single Replication Server connection can support both an ECDA gateway and a Replication Agent, because each of these components connects to the Replication Server on a different thread.
If you replicate information both into and out of the same database, having a common connection for both a database gateway and a Replication Agent can make the replication system network topology less resource intensive.
In the Replication Server, use the create connection command to define the server_name and database_name for the connection. The server_name value must match a configured service name in the ECDA.
In the Replication Agent, set the value of the rs_source_ds parameter to that server_name, and set the value of the rs_source_db parameter to the desired database_name.