Interface ClientServiceHandle<SVC>

Type Parameters:
SVC - the service interface type

@Experimental public interface ClientServiceHandle<SVC>
EXPERIMENTAL API: This interface is part of the new reflection-based API and may change in future releases.

Advanced API handle for invoking Restate services, virtual objects, or workflows from the ingress (outside of a handler). This handle provides advanced invocation capabilities including:

  • Async request handling with CompletableFuture
  • Invocation options such as idempotency keys
  • Fire-and-forget requests via send()
  • Access to full Response metadata

Use this handle to perform requests with method references:


 Client client = Client.connect("http://localhost:8080");

 // 1. Use call() with method reference and wait for the result
 Response<GreetingResponse> response = client.serviceHandle(Greeter.class)
   .call(Greeter::greet, new Greeting("Alice"));

 // 2. Use send() for one-way invocation without waiting
 SendResponse<GreetingResponse> sendResponse = client.serviceHandle(Greeter.class)
   .send(Greeter::greet, new Greeting("Alice"));
 

Create instances using Client.serviceHandle(Class), Client.virtualObjectHandle(Class, String), or Client.workflowHandle(Class, String).

For simple synchronous request-response interactions returning just the output, consider using the simple proxy API instead: Client.service(Class), Client.virtualObject(Class, String), or Client.workflow(Class, String).