Class RestateHandlerProperties

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

public class RestateHandlerProperties extends Object
Configuration properties for a Restate handler.

These properties can be used to configure individual handlers within a Restate service via Spring configuration files.

  • Constructor Details

    • RestateHandlerProperties

      public RestateHandlerProperties()
    • RestateHandlerProperties

      public RestateHandlerProperties(@Nullable String documentation, @Nullable Map<String,String> metadata, @Nullable Duration inactivityTimeout, @Nullable Duration abortTimeout, @Nullable Duration idempotencyRetention, @Nullable Duration workflowRetention, @Nullable Duration journalRetention, @Nullable Boolean ingressPrivate, @Nullable Boolean enableLazyState, @Nullable RetryPolicyProperties retryPolicy)
  • Method Details

    • getDocumentation

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

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

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

      public void setMetadata(@Nullable Map<String,String> metadata)
      Handler 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 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.

    • 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 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.

    • getAbortTimeout

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

    • setAbortTimeout

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

    • getIdempotencyRetention

      public @Nullable Duration getIdempotencyRetention()
      The retention duration of idempotent requests to this handler.

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

      NOTE: This cannot be set for workflow handlers. Use getWorkflowRetention() instead.

    • setIdempotencyRetention

      public void setIdempotencyRetention(@Nullable Duration idempotencyRetention)
      The retention duration of idempotent requests to this handler.

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

      NOTE: This cannot be set for workflow handlers. Use setWorkflowRetention(java.time.Duration) instead.

    • getWorkflowRetention

      public @Nullable Duration getWorkflowRetention()
      The retention duration for workflow handlers.

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

      NOTE: This can only be set for workflow handlers.

    • setWorkflowRetention

      public void setWorkflowRetention(@Nullable Duration workflowRetention)
      The retention duration for workflow handlers.

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

      NOTE: This can only be set for workflow handlers.

    • getJournalRetention

      public @Nullable Duration getJournalRetention()
      The journal retention for invocations to this handler.

      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 for invocations to this handler.

      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 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.

    • setIngressPrivate

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

    • getEnableLazyState

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

    • setEnableLazyState

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

    • getRetryPolicy

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

      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 handler.

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

    • 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