Skip to content

Add caching and logging control options for KTable materialization #3136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gihong-park
Copy link

📋 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

spring:
  cloud:
    stream:
      kafka:
        streams:
          bindings:
            process-input-0:
              consumer:
                cachingDisabled: true
                loggingDisabled: true

🔧 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.

- Add cachingDisabled and loggingDisabled properties to KafkaStreamsConsumerProperties
- Update getMaterialized method to apply caching and logging settings
- Fixes spring-cloudgh-3094

Signed-off-by: gihong-park <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CacheEnabled and LoggingEnabled properties to Kafka Streams binder for enhanced KTable control
1 participant