Skip to content

AWS Redis Serverless - what Spring Redis function to use #3030

@dreamstar-enterprises

Description

@dreamstar-enterprises

Hi there,

For AWS Serverless, do i need to use RedisStandAlone or RedisCluster?

So, this block

     // configure Redis Cluster configuration for production
            val clusterConfig = RedisClusterConfiguration(clusterProperties.nodes)
            clusterConfig.setPassword(RedisPassword.of(springDataProperties.redis.password))
            config = clusterConfig

or

this block

// configure Redis Standalone configuration for non-production

            val staticConfig = RedisStandaloneConfiguration()
            staticConfig.hostName = springDataProperties.redis.host
            staticConfig.port = springDataProperties.redis.port

            staticConfig.setPassword(RedisPassword.of(springDataProperties.redis.password))
            config = staticConfig

If I need to use Standalone, I'm guessing I should remove : .clientOptions(clusterClientOptions), option below

  // create Lettuce client configuration with authentication details
        val clientConfigBuilder = LettucePoolingClientConfiguration.builder()
            .readFrom(REPLICA_PREFERRED)
            // maximum time allowed for a Redis command to execute before the operation is considered timed out.
            .commandTimeout(Duration.ofSeconds(60))
            .clientResources(clientResources)
            .clientOptions(clusterClientOptions)
            .poolConfig(buildLettucePoolConfig())

Is someone able to help clarify which option should work

This query relates somwhat to a closed issue here: #3029

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions