Using RPC API

Using RPC API for remote calls.

Steps

Example

  1. Build RPC Client
CapaRpcClient capaRpcClient = new CapaRpcClientBuilder().build();
  1. Invoke request
Mono<byte[]> responseMono = capaRpcClient.invokeMethod(SERVICE_APP_ID,
        "hello",
        "hello",
        HttpExtension.POST,
        null,
        TypeRef.BYTE_ARRAY);
  1. Get invocation result
byte[] response = responseMono.block();

Explanation

  1. The RPC capabilities provided by CapaRpcClient require concrete implementation, as shown in the example DemoCapaHttp.
  2. After implementing DemoCapaHttp, it needs to be configured in capa-component-rpc.properties, and loaded through the SPI mechanism.

Last modified March 16, 2026: feat: 全面优化 Capa.io 网站 (0dacdd85)