Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-994

Allow disable select(dbIndex) when getAsyncDedicatedConnection in LettuceConnection

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.8 (Lovelace SR8)
    • Fix Version/s: None
    • Component/s: Core, Lettuce Driver
    • Labels:
      None

      Description

      We are using a Redis-Proxy beyond redis cluster, the proxy DOSE NOT support select command

      in LettuceConnection.java,  asyncDedicatedConn always call select(dbIndex) when createConnection, which make my app keep crash

      protected RedisClusterAsyncCommands<byte[], byte[]> getAsyncDedicatedConnection() {
      
         if (asyncDedicatedConn == null) {
      
            asyncDedicatedConn = doGetAsyncDedicatedConnection();
      
            if (asyncDedicatedConn instanceof StatefulRedisConnection) {
               ((StatefulRedisConnection<byte[], byte[]>) asyncDedicatedConn).sync().select(dbIndex);
            }
         }
      
         if (asyncDedicatedConn instanceof StatefulRedisConnection) {
            return ((StatefulRedisConnection<byte[], byte[]>) asyncDedicatedConn).async();
         }
         if (asyncDedicatedConn instanceof StatefulRedisClusterConnection) {
            return ((StatefulRedisClusterConnection<byte[], byte[]>) asyncDedicatedConn).async();
         }
      
         throw new IllegalStateException(
               String.format("%s is not a supported connection type.", asyncDedicatedConn.getClass().getName()));
      }
      

      I would like to call select() when needed or base on config

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cstrobl Christoph Strobl
                Reporter:
                paninigelato PaniniGelato
                Last updater:
                Mark Paluch
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: