Class DurableConfig
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();
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for DurableConfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic DurableConfig.Builderbuilder()Creates a new builder for DurableConfig.static DurableConfigCreates a DurableConfig with default settings.Gets the configured checkpoint delay.Gets the configured DurableExecutionClient.Gets the configured ExecutorService.Gets the configured LoggerConfig.Gets the plugin factories registered via the builder or loaded dynamically, in dispatch order.Gets the polling strategy.Gets the configured SerDes.booleanWhether an empty map operation should emit START and SUCCEED checkpoints.booleanGets whether serialized operation data should be deserialized immediately after serialization.Copies effective factory registrations without repeating environment discovery.void
-
Method Details
-
defaultConfig
Creates a DurableConfig with default settings. Uses default DurableExecutionClient and JacksonSerDes.- Returns:
- DurableConfig with default configuration
-
builder
Creates a new builder for DurableConfig.- Returns:
- Builder instance
-
getDurableExecutionClient
Gets the configured DurableExecutionClient.- Returns:
- DurableExecutionClient instance
-
getSerDes
Gets the configured SerDes.- Returns:
- SerDes instance
-
getExecutorService
Gets the configured ExecutorService.- Returns:
- ExecutorService instance (never null)
-
getLoggerConfig
Gets the configured LoggerConfig.- Returns:
- LoggerConfig instance (never null)
-
getPollingStrategy
Gets the polling strategy.- Returns:
- PollingStrategy instance (never null)
-
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
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
Copies effective factory registrations without repeating environment discovery.The copied builder never performs dynamic discovery, including after
withPluginsreplaces its complete factory list. CallingwithPlugins()removes all factories. Usebuilder()for a fresh configuration that readsDURABLE_EXECUTION_PLUGINS. -
validateConfiguration
public void validateConfiguration()
-