Add caching and logging control options for KTable materialization #3136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 Summary
This PR adds fine-grained control over KTable materialization options in Kafka Streams binder by introducing two new configuration properties: cachingDisabled and loggingDisabled.
🔗 Related Issue Fixes #3094
✨ What's Changed
Added new configuration properties to KafkaStreamsConsumerProperties:
cachingDisabled: Controls whether caching is disabled for materialized KTable
loggingDisabled: Controls whether logging is disabled for materialized KTable
Enhanced AbstractKafkaStreamsBinderProcessor:
Updated getMaterialized method signature to accept caching and logging control parameters
Added logic to apply caching and logging settings to Materialized objects
Integrated new properties with existing KTable and GlobalKTable creation methods
🎯 Benefits
Memory optimization: Users can disable caching to reduce memory usage
Performance tuning: Disabling logging can improve performance in certain scenarios
Flexibility: Provides more granular control over KTable materialization behavior
Backward compatibility: All changes are backward compatible with existing configurations
📝 Configuration Example
🔧 Technical Details
Properties Addition: Added boolean properties with appropriate Javadoc documentation
Method Enhancement: Modified getMaterialized method to conditionally apply caching and logging settings
Integration: Updated both materializedAs and materializedAsGlobalKTable methods to pass new parameters
Null Safety: Implemented null-safe checks for the new boolean properties
📚 Documentation
Added inline Javadoc for new properties
Properties are self-documenting with clear descriptions
Configuration examples provided in PR description
🔄 Migration Guide
No migration required - all changes are additive and backward compatible. Existing applications will continue to work without any modifications.