Skip to content

RedisScript of method improvement [DATAREDIS-1030] #1603

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

Closed
spring-projects-issues opened this issue Aug 23, 2019 · 0 comments
Closed

RedisScript of method improvement [DATAREDIS-1030] #1603

spring-projects-issues opened this issue Aug 23, 2019 · 0 comments
Assignees
Labels
in: core Issues in core support type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

cuillgln opened DATAREDIS-1030 and commented

Hi, when I use redis scripting in spring boot2. with the code following:

@Bean
public RedisScript<Boolean> script() {
  String script = ....;
  return RedisScript.of(script);
}

the I'm tesing the code with IllegalStateException (detail in the attachment).

Finally, I found there is also a method: RedisScript.of(String script, Class<T> classType)
using the RedisScript.of(script, Boolean.class) for the testing is all correct.

But this method DO NOT return a generic RedisScript .

This is the problem, because the IDE complaint...

I think the api should improve. and the RedisScript.of(String script) method without classType parameter can cause problem difficult resolve.

Also this section of the reference document is obsolute.

@Bean
public RedisScript<Boolean> script() {
  ScriptSource scriptSource = new ResourceScriptSource(new ClassPathResource("META-INF/scripts/checkandset.lua"); 
  return RedisScript.of(scriptSource, Boolean.class);
}

the of method first parameter is String type, not the ScriptSource type. It would be update.

 


Affects: 2.1.10 (Lovelace SR10)

Attachments:

Referenced from: pull request #473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants