service

@ApiStatus.Experimental
open fun <SVC> service(clazz: Class<SVC>): SVC

EXPERIMENTAL API: Simple API to invoke a Restate service from the ingress.

Create a proxy client that allows calling service methods directly and synchronously, returning just the output (not wrapped in Response). This is the recommended approach for straightforward request-response interactions.


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

var greeterProxy = client.service(Greeter.class);
GreetingResponse output = greeterProxy.greet(new Greeting("Alice"));

For advanced use cases requiring asynchronous request handling, access to Response metadata, or invocation options (such as idempotency keys), use serviceHandle instead.

Return

a proxy client to invoke the service

Parameters

clazz

the service class annotated with Service