Package software.amazon.lambda.durable
Class DurableConfig
java.lang.Object
software.amazon.lambda.durable.DurableConfig
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() {
LambdaClient lambdaClient = LambdaClient.builder()
.region(Region.US_WEST_2)
.credentialsProvider(ProfileCredentialsProvider.create("my-profile"))
.build();
return DurableConfig.builder()
.withLambdaClient(lambdaClient)
.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 polling strategy.Gets the configured SerDes.
-
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:
- check point in Duration.
-