Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.84 KB

File metadata and controls

39 lines (32 loc) · 1.84 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

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.