Fix Redis Sentinel connection issue by preserving Sentinel Master ID and Hosts in RedisConfig#61
Open
cetingokhan wants to merge 2 commits into
Open
Fix Redis Sentinel connection issue by preserving Sentinel Master ID and Hosts in RedisConfig#61cetingokhan wants to merge 2 commits into
cetingokhan wants to merge 2 commits into
Conversation
This was referenced Jan 6, 2026
Author
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.
Summary
This PR addresses two key issues:
Sentinel Connection: Fixes a bug where configuring a [redis-sentinel] URI failed to establish a connection to the Redis Master because the Sentinel Master ID and Host details were lost during configuration parsing.
Build Environment: Updates the [Dockerfile] to use a supported Gradle image, as the previous OpenJDK image is deprecated and was causing build failures.
Changes
Modified [RedisConfig.java]: Updated [redisURIBuilder()] to explicitly check for sentinelMasterId and sentinels in the parsed URI. If present, they are now manually added to the [RedisURI.Builder] to ensure the final URI is correctly configured for Sentinel mode.
Updated [Dockerfile]: Replaced the deprecated openjdk:18-jdk-slim build image with gradle:8.10.0-jdk17. This fixes ./gradlew execution issues and ensures a stable build environment compatible with the project's Java 17 requirement.
Added Unit Test: Added [testRedisSentinelValueConfig] in [StreamSourceConnectorTest.java] to verify that [redis-sentinel] URIs are correctly parsed and that the Master ID and Sentinel hosts are preserved.
Testing
Unit Testing: Verified with the new test case [StreamSourceConnectorTest.testRedisSentinelValueConfig].
Integration Testing: Validated in a local Docker Compose environment with a dedicated Redis Sentinel setup.
Confirmed successful connection for both Sink and Source connectors using [redis-sentinel://] URIs.
Verified password authentication and consumer group functionality with Sentinel.
Build Verification: Confirmed that the project builds successfully with the new Dockerfile configuration.
Related Issue
Fixes [java.lang.IllegalStateException: Cannot build a RedisURI. One of the following must be provided Host, Socket or Sentinel] when using Sentinel and resolves build failures due to deprecated base images.