Class HandlerDefinition.Configurator
- Enclosing class:
HandlerDefinition<REQ,
RES>
HandlerDefinition
.-
Method Summary
Modifier and TypeMethodDescription@Nullable Duration
abortTimeout
(@Nullable Duration abortTimeout) This timer guards against stalled invocations that are supposed to terminate.@Nullable String
acceptContentType
(@Nullable String acceptContentType) Set the acceptable content type when ingesting HTTP requests.addMetadata
(String key, String value) @Nullable String
documentation
(@Nullable String documentation) Documentation as shown in the UI, Admin REST API, and the generated OpenAPI documentation of this handler.@Nullable Boolean
enableLazyState
(@Nullable Boolean enableLazyState) When set totrue
, lazy state will be enabled for all invocations to this handler.@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 handler 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 for invocations to this handler.metadata()
Handler metadata, as propagated in the Admin REST API.@Nullable Duration
workflowRetention
(@Nullable Duration workflowRetention) The retention duration for this workflow handler.
-
Method Details
-
acceptContentType
- Returns:
- configured accepted content type.
- See Also:
-
acceptContentType
Set the acceptable content type when ingesting HTTP requests. Wildcards can be used, e.g.application / *
or* / *
.- Returns:
- this
-
documentation
- Returns:
- configured documentation.
- See Also:
-
documentation
Documentation as shown in the UI, Admin REST API, and the generated OpenAPI documentation of this handler.- Returns:
- this
-
metadata
- Returns:
- configured metadata.
- See Also:
-
addMetadata
- See Also:
-
metadata
Handler 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 inactivity timeout set for the service and the default set in restate-server.
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 invocations that are supposed to terminate. The abort timeout is started after theinactivityTimeout(Duration)
has expired and the invocation has been asked to gracefully terminate. Once the timer expires, it will abort the 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 abort timeout set for the service and the default set in restate-server.
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
-
workflowRetention
- Returns:
- configured workflow retention.
- See Also:
-
workflowRetention
The retention duration for this workflow handler.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 for invocations to this handler.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 handler 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 handler. 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
-