Skip to content

Add Configurable Property for Custom Session Index Name in Redis #3254

Open
@AlefMemTav

Description

@AlefMemTav

Note: I'm not sure if it's currently possible to configure this index name, at least not in an easy or straightforward way.

It should be possible to configure a custom name for the session index, allowing shorter and more readable entries in Redis. This could help users who need simpler key structures for session management, enhancing readability and potentially optimizing performance by avoiding long, repetitive index names.

Currently, the session index name is hard-coded asorg.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME. When retrieving keys with commands like keys *, this long, detailed naming convention leads to outputs such as:

spring:session:index:org.springframework.session.FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME:pedro123

This default naming makes the keys verbose and harder to work with.

This issue impacts readability and manageability of session-related keys in Redis. When working with numerous sessions, especially for applications with a high volume of users, this long index name can clutter the database and make debugging more challenging. I've explored options for a workaround, but currently, the only solution would be to allow a configurable property for this session index name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions