Package dev.restate.sdk.endpoint
Class Endpoint.Builder
java.lang.Object
dev.restate.sdk.endpoint.Endpoint.Builder
- Enclosing class:
Endpoint
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbind
(ServiceDefinition serviceDefinition) Add a manualServiceDefinition
to the endpoint.Add a Restate service to the endpoint.bind
(Object service, HandlerRunner.Options options) Likebind(Object)
, but allows to provide options for the handler runner.build()
io.opentelemetry.api.OpenTelemetry
void
setOpenTelemetry
(io.opentelemetry.api.OpenTelemetry openTelemetry) Same aswithOpenTelemetry(OpenTelemetry)
.void
setRequestIdentityVerifier
(RequestIdentityVerifier requestIdentityVerifier) withOpenTelemetry
(io.opentelemetry.api.OpenTelemetry openTelemetry) Set theOpenTelemetry
implementation for tracing and metrics.withRequestIdentityVerifier
(RequestIdentityVerifier requestIdentityVerifier) Set the request identity verifier for this endpoint.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
bind
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
usingbind(ServiceDefinition)
. -
bind
Likebind(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
Add a manualServiceDefinition
to the endpoint. -
withOpenTelemetry
Set theOpenTelemetry
implementation for tracing and metrics.- See Also:
-
setOpenTelemetry
public void setOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry) Same aswithOpenTelemetry(OpenTelemetry)
. -
getOpenTelemetry
public io.opentelemetry.api.OpenTelemetry getOpenTelemetry()- Returns:
- the configured
OpenTelemetry
-
withRequestIdentityVerifier
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
-
getRequestIdentityVerifier
- Returns:
- the configured request identity verifier
-
enablePreviewContext
-
build
-