Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.1.10 (Lovelace SR10)
    • Fix Version/s: 2.2 RC3 (Moore)
    • Component/s: Core
    • Labels:
      None

      Description

      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.

       

        Attachments

          Activity

            People

            • Assignee:
              mp911de Mark Paluch
              Reporter:
              cuillgln cuillgln
              Last updater:
              Mark Paluch
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1.5d
                1.5d
                Remaining:
                Remaining Estimate - 1.5d
                1.5d
                Logged:
                Time Spent - Not Specified
                Not Specified