Skip to main content

Customizing default operations

For example, the LOAD operation can be overridden to enforce a custom topic processing order. For an example of this, see Custom Topic Ordering.

Adding operations

Configuration

@Configuration
public class CustomOperationsConfig {
    @Bean
    public IDlcOperation<CustomResponse, CustomRequest> customOperation() {
        return new IDlcOperation<>() {
            @Override
            public String getName() {
                return "CUSTOM";
            }

            @Override
            public CustomResponse process(CustomRequest request) {
                // Custom logic
            }
        };
    }
}
Alternatively, annotate the CustomOperation class with @Component and let Spring manage the bean creation.

Custom operation

@RequiredArgsConstructor
@Component
public class CustomOperation implements IDlcOperation<CustomResponse, CustomRequest> {

    @Override
    public String getName() {
        return "CUSTOM";
    }

    @Override
    public CustomResponse process(CustomRequest request) {
        // Custom logic
    }
}