Class RestateComponentProperties

java.lang.Object
dev.restate.sdk.springboot.RestateComponentProperties

public class RestateComponentProperties extends Object
Configuration properties for a Restate service/component.

These properties can be used to configure Restate services via Spring configuration files.

  • Constructor Details

  • Method Details

    • getExecutor

      public @Nullable String getExecutor()
      Name of the Executor bean to use for running handlers of this service. If not specified, the global default from RestateComponentsProperties is used.

      NOTE: This option is only used for Java services, not Kotlin services.

      If not specified (neither here nor globally), virtual threads are used for Java >= 21, otherwise Executors.newCachedThreadPool() is used. See HandlerRunner.Options.withExecutor() for more details.

    • setExecutor

      public void setExecutor(@Nullable String executor)
      Name of the Executor bean to use for running handlers of this service. If not specified, the global default from RestateComponentsProperties is used.

      NOTE: This option is only used for Java services, not Kotlin services.

      If not specified (neither here nor globally), virtual threads are used for Java >= 21, otherwise Executors.newCachedThreadPool() is used. See HandlerRunner.Options.withExecutor() for more details.

    • getDocumentation

      public @Nullable String getDocumentation()
      Documentation as shown in the UI, Admin REST API, and the generated OpenAPI documentation of this service.
    • setDocumentation

      public void setDocumentation(@Nullable String documentation)
      Documentation as shown in the UI, Admin REST API, and the generated OpenAPI documentation of this service.
    • getMetadata

      public @Nullable Map<String,String> getMetadata()
      Service metadata, as propagated in the Admin REST API.
    • setMetadata

      public void setMetadata(@Nullable Map<String,String> metadata)
      Service metadata, as propagated in the Admin REST API.
    • getInactivityTimeout

      public @Nullable Duration getInactivityTimeout()
      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 getAbortTimeout() 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.

    • setInactivityTimeout

      public void setInactivityTimeout(@Nullable Duration 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 getAbortTimeout() 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.

    • getAbortTimeout

      public @Nullable Duration getAbortTimeout()
      This timer guards against stalled service/handler invocations that are supposed to terminate. The abort timeout is started after the getInactivityTimeout() 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.

    • setAbortTimeout

      public void setAbortTimeout(@Nullable Duration abortTimeout)
      This timer guards against stalled service/handler invocations that are supposed to terminate. The abort timeout is started after the getInactivityTimeout() 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.

    • getIdempotencyRetention

      public @Nullable Duration getIdempotencyRetention()
      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.

    • setIdempotencyRetention

      public void setIdempotencyRetention(@Nullable Duration 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.

    • getWorkflowRetention

      public @Nullable Duration getWorkflowRetention()
      The retention duration of idempotent requests to this workflow service. This applies only to workflow services.

      NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.

    • setWorkflowRetention

      public void setWorkflowRetention(@Nullable Duration workflowRetention)
      The retention duration of idempotent requests to this workflow service. This applies only to workflow services.

      NOTE: You can set this field only if you register this service against restate-server >= 1.4, otherwise the service discovery will fail.

    • getJournalRetention

      public @Nullable Duration getJournalRetention()
      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 getIdempotencyRetention() 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.

    • setJournalRetention

      public void setJournalRetention(@Nullable Duration 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 getIdempotencyRetention() 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.

    • getIngressPrivate

      public @Nullable Boolean getIngressPrivate()
      When set to true 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.

    • setIngressPrivate

      public void setIngressPrivate(@Nullable Boolean ingressPrivate)
      When set to true 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.

    • getEnableLazyState

      public @Nullable Boolean getEnableLazyState()
      When set to true, 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.

    • setEnableLazyState

      public void setEnableLazyState(@Nullable Boolean enableLazyState)
      When set to true, 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.

    • getRetryPolicy

      public @Nullable RetryPolicyProperties getRetryPolicy()
      Retry policy used by Restate when invoking this service.

      NOTE: You can set this field only if you register this service against restate-server >= 1.5, otherwise the service discovery will fail.

    • setRetryPolicy

      public void setRetryPolicy(@Nullable RetryPolicyProperties retryPolicy)
      Retry policy used by Restate when invoking this service.

      NOTE: You can set this field only if you register this service against restate-server >= 1.5, otherwise the service discovery will fail.

    • getHandlers

      public @Nullable Map<String,RestateHandlerProperties> getHandlers()
      Per-handler configuration, keyed by handler name.
    • setHandlers

      public void setHandlers(@Nullable Map<String,RestateHandlerProperties> handlers)
      Per-handler configuration, keyed by handler name.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object