Class Endpoint.Builder

java.lang.Object
dev.restate.sdk.endpoint.Endpoint.Builder
Enclosing class:
Endpoint

public static class Endpoint.Builder extends Object
  • Constructor Details Link icon

    • Builder Link icon

      public Builder()
  • Method Details Link icon

    • bind Link icon

      public Endpoint.Builder bind(Object service)
      Add a Restate service to the endpoint. This will automatically discover the generated factory based on the class name.

      You can also manually instantiate the ServiceDefinition using bind(ServiceDefinition).

    • bind Link icon

      public Endpoint.Builder bind(Object service, HandlerRunner.Options options)
      Like bind(Object), but allows to provide options for the handler runner. This allows to configure for the Java API the executor where to run the handler code, or the Kotlin API the coroutine context.

      Look at the respective documentations of the HandlerRunner class in the Java or in the Kotlin module.

      See Also:
    • bind Link icon

      public Endpoint.Builder bind(ServiceDefinition serviceDefinition)
      Add a manual ServiceDefinition to the endpoint.
    • withOpenTelemetry Link icon

      public Endpoint.Builder withOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
      Set the OpenTelemetry implementation for tracing and metrics.
      See Also:
      • OpenTelemetry
    • setOpenTelemetry Link icon

      public void setOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
    • getOpenTelemetry Link icon

      public io.opentelemetry.api.OpenTelemetry getOpenTelemetry()
      Returns:
      the configured OpenTelemetry
    • withRequestIdentityVerifier Link icon

      public Endpoint.Builder withRequestIdentityVerifier(RequestIdentityVerifier requestIdentityVerifier)
      Set the request identity verifier for this endpoint.

      For the Restate implementation to use with Restate Cloud, check the module sdk-request-identity.

    • setRequestIdentityVerifier Link icon

      public void setRequestIdentityVerifier(RequestIdentityVerifier requestIdentityVerifier)
    • getRequestIdentityVerifier Link icon

      public RequestIdentityVerifier getRequestIdentityVerifier()
      Returns:
      the configured request identity verifier
    • enablePreviewContext Link icon

      public Endpoint.Builder enablePreviewContext()
    • build Link icon

      public Endpoint build()