Class MultiRPCClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    
    public final class MultiRPCClient<I extends RPCOps>
     implements AutoCloseable
                        

    An RPC client connects to the specified server and allows to make calls using specified remote interface to the server that perform various useful tasks. Please see the Client RPC section of Corda Documentation to learn more about how this API works. Only a brief description is provided here.

    Calling start returns an RPCConnection containing a proxy that allows making RPCs calls to the server. This is a blocking communication, and if the server throws an exception then it will be rethrown on the client. Proxies are thread safe and may be used to invoke multiple RPCs in parallel.

    RPC sends and receives are logged on the net.corda.rpc logger.

    In case of loss of connection to the server, the client will try to reconnect using the settings provided via CordaRPCClientConfiguration. If the client was created using a list of hosts via haAddressPool, automatic failover will occur (the servers have to be started in HA mode). While attempting failover, current and future RPC calls will throw RPCException.

    It is also possible to add RPCConnectionListeners event before connection is started to be notified about connection lifecycle. Please see documentation on RPCConnectionListener for more details.