Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 2.09 KB

File metadata and controls

41 lines (34 loc) · 2.09 KB

Configuration

Customize SDK behavior by overriding createConfiguration() in your handler:

public class OrderProcessor extends DurableHandler<Order, OrderResult> {

    @Override
    protected DurableConfig createConfiguration() {
        // Custom Lambda client with connection pooling
        var lambdaClientBuilder = LambdaClient.builder()
            .httpClient(ApacheHttpClient.builder()
                .maxConnections(50)
                .connectionTimeout(Duration.ofSeconds(30))
                .build());

        return DurableConfig.builder()
            .withLambdaClientBuilder(lambdaClientBuilder)
            .withSerDes(new MyCustomSerDes())           // Custom serialization
            .withExecutorService(Executors.newFixedThreadPool(10))  // Custom thread pool
            .withLoggerConfig(LoggerConfig.withReplayLogging())     // Enable replay logs
            .build();
    }

    @Override
    protected OrderResult handleRequest(Order order, DurableContext ctx) {
        // Your handler logic
    }
}
Option Description Default
withLambdaClientBuilder() Custom AWS Lambda client Auto-configured Lambda client
withSerDes() Serializer for step results Jackson with default settings
withExecutorService() Thread pool for user-defined operations Cached daemon thread pool
withLoggerConfig() Logger behavior configuration Suppress logs during replay
withPollingStrategy() Backend polling strategy Exponential backoff: 1s base, 2x rate, FULL jitter, 10s max
withCheckpointDelay() How often the SDK checkpoints updates Duration.ofSeconds(0) (as soon as possible)

The withExecutorService() option configures the thread pool used for running user-defined operations. Internal SDK coordination (checkpoint batching, polling) runs on an SDK-managed thread pool.