Skip to content
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

Unable to use redis sessions with AWS Elasticache #81

Open
zwilias opened this issue Oct 25, 2023 · 0 comments
Open

Unable to use redis sessions with AWS Elasticache #81

zwilias opened this issue Oct 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@zwilias
Copy link

zwilias commented Oct 25, 2023

Description

AWS Elasticache, like most cloud-based redis offerings, run in secure mode, which effectively disables the CONFIG command. However, the JedisConnectionFactory as configured in WEB-INF/applicationContext-session-redis.xml will attempt to use the CONFIG command to enable keyspace notifications.

Priority

Low

Resolution

I have no budget and there's no rush, please add this feature for free

More information

We are working around this particular issue by replacing the applicationContext-session-redis.xml with the following in our war:

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/context
        https://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util.xsd">
    <context:annotation-config />
    <bean class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration" p:configureRedisAction-ref="configureRedisAction" />
    <util:constant id="configureRedisAction" static-field="org.springframework.session.data.redis.config.ConfigureRedisAction.NO_OP"/>
    <bean name="jedisConnectionFactory" 
        class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
        p:hostName="${structurizr.redis.host}" 
        p:port="${structurizr.redis.port}" 
        p:password="${structurizr.redis.password}" />
</beans>

This works, though ideally something like structurizr.redis.secure to toggle this behaviour would be quite a bit more ergonomic, much like spinnaker offers.

@zwilias zwilias added the enhancement New feature or request label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant