Package dev.restate.sdk.http.vertx
Class RestateHttpEndpointBuilder
- java.lang.Object
-
- dev.restate.sdk.http.vertx.RestateHttpEndpointBuilder
-
public class RestateHttpEndpointBuilder extends java.lang.ObjectEndpoint builder for a Restate HTTP Endpoint using Vert.x, to serve Restate services.This endpoint supports the Restate HTTP/2 Streaming component Protocol.
Example usage:
public static void main(String[] args) { RestateHttpEndpointBuilder.builder() .bind(new Counter()) .buildAndListen(); }
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RestateHttpEndpointBuilderbind(dev.restate.sdk.common.BindableService<?> service)Add a Restate bindable service to the endpoint.<O> RestateHttpEndpointBuilderbind(dev.restate.sdk.common.BindableService<O> service, O options)Add a Restate bindable service to the endpoint, overriding the options.RestateHttpEndpointBuilderbind(java.lang.Object service)Add a Restate service to the endpoint.io.vertx.core.http.HttpServerbuild()Build theHttpServerserving the Restate service endpoint.voidbuildAndListen()Build and listen on the port specified by the environment variablePORT, or alternatively on the default9080port.voidbuildAndListen(int port)Build and listen on the specified port.static RestateHttpEndpointBuilderbuilder()Create a new builder.static RestateHttpEndpointBuilderbuilder(io.vertx.core.Vertx vertx)Create a new builder.RestateHttpEndpointBuilderwithOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)Add aOpenTelemetryimplementation for tracing and metrics.RestateHttpEndpointBuilderwithOptions(io.vertx.core.http.HttpServerOptions options)Add customHttpServerOptionsto the server used by the endpoint.
-
-
-
Method Detail
-
builder
public static RestateHttpEndpointBuilder builder()
Create a new builder.
-
builder
public static RestateHttpEndpointBuilder builder(io.vertx.core.Vertx vertx)
Create a new builder.
-
withOptions
public RestateHttpEndpointBuilder withOptions(io.vertx.core.http.HttpServerOptions options)
Add customHttpServerOptionsto the server used by the endpoint.
-
bind
public RestateHttpEndpointBuilder bind(java.lang.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
BindableServiceusingbind(BindableService).
-
bind
public RestateHttpEndpointBuilder bind(dev.restate.sdk.common.BindableService<?> service)
Add a Restate bindable service to the endpoint.To override the options, use
bind(BindableService, Object).
-
bind
public <O> RestateHttpEndpointBuilder bind(dev.restate.sdk.common.BindableService<O> service, O options)
Add a Restate bindable service to the endpoint, overriding the options.
-
withOpenTelemetry
public RestateHttpEndpointBuilder withOpenTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry)
Add aOpenTelemetryimplementation for tracing and metrics.- See Also:
OpenTelemetry
-
buildAndListen
public void buildAndListen(int port)
Build and listen on the specified port.
-
buildAndListen
public void buildAndListen()
Build and listen on the port specified by the environment variablePORT, or alternatively on the default9080port.
-
build
public io.vertx.core.http.HttpServer build()
Build theHttpServerserving the Restate service endpoint.
-
-