Class ServiceDefinition.Configurator
- Enclosing class:
ServiceDefinition
ServiceDefinition
.-
Method Summary
Modifier and TypeMethodDescription@Nullable Duration
abortTimeout
(@Nullable Duration abortTimeout) This timer guards against stalled service/handler invocations that are supposed to terminate.addMetadata
(String key, String value) configureHandler
(String handlerName, Consumer<HandlerDefinition.Configurator> configurator) Configure a specific handler of this service.@Nullable String
documentation
(@Nullable String documentation) Documentation as shown in the UI, Admin REST API, and the generated OpenAPI documentation of this service.@Nullable Boolean
enableLazyState
(@Nullable Boolean enableLazyState) When set totrue
, lazy state will be enabled for all invocations to this service.@Nullable Duration
idempotencyRetention
(@Nullable Duration idempotencyRetention) The retention duration of idempotent requests to this service.@Nullable Duration
inactivityTimeout
(@Nullable Duration inactivityTimeout) This timer guards against stalled invocations.@Nullable Boolean
ingressPrivate
(@Nullable Boolean ingressPrivate) When set totrue
this service, with all its handlers, cannot be invoked from the restate-server HTTP and Kafka ingress, but only from other services.@Nullable Duration
journalRetention
(@Nullable Duration journalRetention) The journal retention.metadata()
Service metadata, as propagated in the Admin REST API.
-
Method Details
-
documentation
- Returns:
- configured documentation.
- See Also:
-
documentation
Documentation as shown in the UI, Admin REST API, and the generated OpenAPI documentation of this service.- Returns:
- this
-
metadata
- Returns:
- configured metadata.
- See Also:
-
addMetadata
- See Also:
-
metadata
Service metadata, as propagated in the Admin REST API.- Returns:
- this
-
inactivityTimeout
- Returns:
- configured inactivity timeout.
- See Also:
-
inactivityTimeout
This timer guards against stalled invocations. Once it expires, Restate triggers a graceful termination by asking the invocation to suspend (which preserves intermediate progress).The
abortTimeout(Duration)
is used to abort the invocation, in case it doesn't react to the request to suspend.This overrides the default inactivity timeout configured in the restate-server for all invocations to this service.
NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.
- Returns:
- this
-
abortTimeout
- Returns:
- configured abort timeout.
- See Also:
-
abortTimeout
This timer guards against stalled service/handler invocations that are supposed to terminate. The abort timeout is started after theinactivityTimeout(Duration)
has expired and the service/handler invocation has been asked to gracefully terminate. Once the timer expires, it will abort the service/handler invocation.This timer potentially interrupts user code. If the user code needs longer to gracefully terminate, then this value needs to be set accordingly.
This overrides the default abort timeout configured in the restate-server for all invocations to this service.
NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.
- Returns:
- this
-
idempotencyRetention
- Returns:
- configured idempotency retention.
- See Also:
-
idempotencyRetention
The retention duration of idempotent requests to this service.NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.
- Returns:
- this
-
journalRetention
- Returns:
- configured journal retention.
- See Also:
-
journalRetention
The journal retention. When set, this applies to all requests to all handlers of this service.In case the request has an idempotency key, the
idempotencyRetention(Duration)
caps the journal retention time.NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.
- Returns:
- this
-
ingressPrivate
- Returns:
- configured ingress private.
- See Also:
-
ingressPrivate
When set totrue
this service, with all its handlers, cannot be invoked from the restate-server HTTP and Kafka ingress, but only from other services.NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.
- Returns:
- this
-
enableLazyState
- Returns:
- configured enable lazy state.
- See Also:
-
enableLazyState
When set totrue
, lazy state will be enabled for all invocations to this service. This is relevant only for workflows and virtual objects.NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.
- Returns:
- this
-
configureHandler
public ServiceDefinition.Configurator configureHandler(String handlerName, Consumer<HandlerDefinition.Configurator> configurator) Configure a specific handler of this service.- Returns:
- this
-