Add support for infrastructure provider connectors#26
Open
Add support for infrastructure provider connectors#26
Conversation
Add comprehensive Redis connector support following Hazelcast patterns: Core Infrastructure: - RedisConfiguration with standalone mode support (extensible for Sentinel/Cluster) - RedisConnectionFactory and RedisConnectionsManager using Lettuce client - RedisTaxi schema with annotations for service, key patterns, TTL, streams, and pub/sub - JSON serialization support (RedisJsonValueReader/Writer) Invokers: - RedisQueryInvoker: GET and SCAN operations - RedisMutatingInvoker: SET/SETEX and DEL operations with TTL support - RedisStreamInvoker: Support for Redis Streams, Pub/Sub, and keyspace notifications - RedisInvoker: Main routing invoker Advanced Features: - RedisCachingProvider: Cache-aside pattern implementation - RedisStateStore: State storage for stream merging operations - Spring Boot integration via RedisConnectorConfig Configuration: - Updated ConnectionsConfig to include Redis connections - Added Redis support to SourceLoaderConnectorsRegistry - Updated parent pom.xml to include redis-connector module Key Features: - Standalone Redis support (architecture ready for Sentinel/Cluster) - JSON serialization only - Per-key TTL via annotations - Triple streaming support: Redis Streams, Pub/Sub, and keyspace notifications - Comprehensive query, mutation, and streaming capabilities
Add test coverage following Hazelcast test patterns:
Test Infrastructure:
- BaseRedisInvokerTest: Base class with vyneWithRedis() helper
- TestRedisProvider: Mock provider for dependency injection
- Testcontainers integration for real Redis instance
- Automatic cleanup between tests
Query Tests (RedisQueryTest):
- ID lookup using specific keys
- Find all with SCAN operations
- Criteria-based queries (single and multiple matches)
- Compound criteria with multiple conditions
- Non-existent key handling
- Key pattern verification (film:{filmId})
Mutation Tests (RedisMutatingInvokerTest):
- Write objects to Redis with JSON serialization
- Verify operation results and cache exchange metadata
- Read and write multiple objects
- Delete by key
- Delete all by pattern
- TTL support with expiration verification
Streaming Tests (RedisStreamQueryTest):
- Redis Streams consumer (XREAD)
- Pub/Sub streaming (SUBSCRIBE)
- Keyspace notifications
- Tests marked as @disabled with setup requirements documented
Dependencies Added:
- mockito-kotlin for mocking
- kotest for assertions
- turbine for Flow testing
- Testcontainers already present
All tests follow the established patterns from Hazelcast tests using:
- kotest matchers for assertions
- Turbine for testing Kotlin Flows
- setupDefaultItems() helper for test data
- Proper cleanup in @AfterEach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add comprehensive Redis connector support following Hazelcast patterns:
Core Infrastructure:
Invokers:
Advanced Features:
Configuration:
Key Features: