Skip to content

Add read-only script execution#3368

Open
won-seoop wants to merge 1 commit into
spring-projects:mainfrom
won-seoop:gh-2617-script-execution
Open

Add read-only script execution#3368
won-seoop wants to merge 1 commit into
spring-projects:mainfrom
won-seoop:gh-2617-script-execution

Conversation

@won-seoop
Copy link
Copy Markdown

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

This PR adds read-only script execution support so callers can explicitly execute scripts through EVAL_RO/EVALSHA_RO where supported.

Changes include:

  • Add executeReadOnly(…) variants to RedisOperations and ScriptExecutor.
  • Add evalReadOnly(…) and evalShaReadOnly(…) to Redis scripting command APIs, including string-friendly delegates.
  • Route Lettuce and Jedis through their read-only scripting APIs.
  • Register read-only script method aliases for command classification in connection splitting.
  • Add unit coverage for script executor routing, command lookup aliases, and read-only connection splitting.

Closes #2617

Tests:

  • ./mvnw -q -DskipITs -DskipDocker -Dtest=DefaultScriptExecutorUnitTests,RedisCommandUnitTests,RedisConnectionUtilsUnitTests test
  • ./mvnw -q -DskipITs -DskipDocker -DskipTests compile test-compile
  • ./mvnw -q -DskipITs -DskipDocker test fails locally because Redis is not running on 127.0.0.1:6379.

Signed-off-by: halo <dongjin778@naver.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 22, 2026
@won-seoop won-seoop marked this pull request as ready for review May 22, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedisTemplate.execute doesn't allow to specify action type and treats operation type as "read" by default

2 participants