rpc_conns: add docs section about bidirectional conns

Also included details about the *http_jsonrpc codec
This commit is contained in:
ionutboangiu
2024-10-30 19:08:42 +02:00
committed by Dan Christian Bogos
parent 730d99734c
commit 5242ba2440

View File

@@ -46,6 +46,16 @@ Predefined Connection Pools
\*bijson_localhost \*bijson_localhost
Bidirectional JSON-RPC connection to local cgr-engine on port 2014 Bidirectional JSON-RPC connection to local cgr-engine on port 2014
Bidirectional Communication with SessionS
-----------------------------------------
Bidirectional connections are specifically designed and used for communication between agents and the :ref:`SessionS <sessions>` component. While agents can send requests using standard connections, bidirectional connections are necessary when SessionS needs to communicate back to the agents.
When using bidirectional connections, SessionS maintains references to all connected agents, allowing it to send requests back to specific agents when needed (for example, to force disconnect a session or query active sessions).
.. note::
Bidirectional connections (``*birpc_internal``, ``*birpc_json``, ``*birpc_gob``) are exclusively used for Agent-SessionS communication. All other service interactions use standard one-way connections.
Parameters Parameters
---------- ----------
@@ -78,10 +88,10 @@ Connection Parameters
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
Address Address
Network address or ``*internal`` Network address, ``*internal``, or ``*birpc_internal``
Transport Transport
Protocol (``*json``, ``*gob``, ``*birpc_json``, ``*birpc_gob``). Defaults to ``*gob`` Protocol (``*json``, ``*gob``, ``*birpc_json``, ``*birpc_gob``, ``*http_jsonrpc``). When using ``*internal`` or ``*birpc_internal`` addresses, defaults to the address value. Otherwise defaults to ``*gob``.
ConnectAttempts ConnectAttempts
Number of initial connection attempts Number of initial connection attempts
@@ -114,15 +124,18 @@ CaCertificate
Transport Performance Transport Performance
--------------------- ---------------------
\*internal \*internal, \*birpc_internal
In-process communication (by far the fastest) In-process communication (by far the fastest)
\*gob \*gob, \*birpc_gob
Binary protocol that provides better performance at the cost of being harder to troubleshoot Binary protocol that provides better performance at the cost of being harder to troubleshoot
\*json \*json, \*birpc_json
Standard JSON protocol - slower but easier to debug since you can read the traffic Standard JSON protocol - slower but easier to debug since you can read the traffic
\*http_jsonrpc
HTTP-based JSON-RPC protocol - slower than direct JSON-RPC due to HTTP overhead, but can integrate with web infrastructure and provides easy debugging through standard HTTP tools
.. note:: .. note::
While the "transport" parameter name is used in the configuration, it actually specifies the codec (*json, *gob) used for data encoding. All network connections use TCP, while internal ones skip networking completely. While the "transport" parameter name is used in the configuration, it actually specifies the codec (*json, *gob) used for data encoding. All network connections use TCP, while internal ones skip networking completely.