Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Reactive WebSessions do not seem to get cleaned up in Mongo #226

Open
zargarf opened this issue Nov 16, 2023 · 0 comments
Open

Reactive WebSessions do not seem to get cleaned up in Mongo #226

zargarf opened this issue Nov 16, 2023 · 0 comments

Comments

@zargarf
Copy link

zargarf commented Nov 16, 2023

Hi

I'm trying to swap out using spring-session-data-redis for spring-session-data-mongo in a Webflux spring-cloud-gateway.
Previously with the redis implementation session information in redis was correctly auto deleted after expiry. However with the reactive mongo implementation this does not seem to be happening, and old session data remains persisted forever.
I'm using spring-boot 3.1.5, webflux, reactive mongo with Oauth2 flows in spring-security.

Could someone please clarify whether these sessions are meant to be auto-cleaned up after their expiry? I don't see any additional date-related indices on the collection when the database is autocreated.

dependecies in pom:

  <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
       <version>3.1.5</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.session</groupId>
      <artifactId>spring-session-data-mongodb</artifactId>
      <version>3.1.3</version>
    </dependency>

Expected behavior

Expired sessions should be deleted from Mongodb

Actual behavior

Old sessions remain in Mongodb

Reactor Netty version: 1.1.12

JVM version (e.g. java -version): 20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant