Skip to content

Conversation

@martypitt
Copy link
Contributor

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

3 participants