Class DurableConfig

java.lang.Object
software.amazon.lambda.durable.DurableConfig

public final class DurableConfig extends Object
Configuration for DurableHandler initialization. This class provides a builder pattern for configuring SDK components including LambdaClient, SerDes, and ExecutorService.

Configuration is initialized once during Lambda cold start and remains immutable throughout the execution lifecycle.

Example usage with default settings:


 @Override
 protected DurableConfig createConfiguration() {
     return DurableConfig.builder()
         .withDurableExecutionClient(customClient)
         .withSerDes(customSerDes)
         .build();
 }
 

Example usage with custom Lambda client:


 @Override
 protected DurableConfig createConfiguration() {
     LambdaClientBuilder lambdaClientBuilder = LambdaClient.builder()
         .region(Region.US_WEST_2)
         .credentialsProvider(ProfileCredentialsProvider.create("my-profile"));

     return DurableConfig.builder()
         .withLambdaClientBuilder(lambdaClientBuilder)
         .build();
 }
 
  • Method Details

    • defaultConfig

      public static DurableConfig defaultConfig()
      Creates a DurableConfig with default settings. Uses default DurableExecutionClient and JacksonSerDes.
      Returns:
      DurableConfig with default configuration
    • builder

      public static DurableConfig.Builder builder()
      Creates a new builder for DurableConfig.
      Returns:
      Builder instance
    • getDurableExecutionClient

      public DurableExecutionClient getDurableExecutionClient()
      Gets the configured DurableExecutionClient.
      Returns:
      DurableExecutionClient instance
    • getSerDes

      public SerDes getSerDes()
      Gets the configured SerDes.
      Returns:
      SerDes instance
    • getExecutorService

      public ExecutorService getExecutorService()
      Gets the configured ExecutorService.
      Returns:
      ExecutorService instance (never null)
    • getLoggerConfig

      public LoggerConfig getLoggerConfig()
      Gets the configured LoggerConfig.
      Returns:
      LoggerConfig instance (never null)
    • getPollingStrategy

      public PollingStrategy getPollingStrategy()
      Gets the polling strategy.
      Returns:
      PollingStrategy instance (never null)
    • getCheckpointDelay

      public Duration getCheckpointDelay()
      Gets the configured checkpoint delay.
      Returns:
      the checkpoint delay duration
    • shouldDeserializeAfterSerialization

      public boolean shouldDeserializeAfterSerialization()
      Gets whether serialized operation data should be deserialized immediately after serialization.

      When enabled, the SDK returns deserialized operation results so first execution matches replay, and validates serialized exceptions before checkpointing them. Defaults to true, and custom SerDes implementations are still expected to be round-trip safe even if this behavior is disabled.

      Returns:
      true when serialized data should be deserialized immediately
    • shouldCheckpointEmptyMap

      public boolean shouldCheckpointEmptyMap()
      Whether an empty map operation should emit START and SUCCEED checkpoints. Defaults to not checkpointing; this default and the flag are expected to be removed in a future major version.
      Returns:
      true when empty maps should be checkpointed
    • getPluginFactories

      public List<DurableExecutionPluginFactory> getPluginFactories()
      Gets the plugin factories registered via the builder or loaded dynamically, in dispatch order.

      Each factory is called once per Lambda invocation to create that invocation's plugin instance; the SDK never shares a plugin instance across invocations.

      Returns:
      immutable list of plugin factories (never null, possibly empty)
    • toBuilder

      public DurableConfig.Builder toBuilder()
      Copies effective factory registrations without repeating environment discovery.

      The copied builder never performs dynamic discovery, including after withPlugins replaces its complete factory list. Calling withPlugins() removes all factories. Use builder() for a fresh configuration that reads DURABLE_EXECUTION_PLUGINS.

    • validateConfiguration

      public void validateConfiguration()