Skip to content

Add MongoDB support to Spring Session sample #10374

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spring-boot-samples/spring-boot-sample-session/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ supports multiple session store types, including:
* `Redis`
* `JDBC`
* `Hazelcast`
* `MongoDB`



Expand Down Expand Up @@ -46,3 +47,14 @@ automatically configure the underlying `HazelcastInstance`.

TIP: Run sample application using Hazelcast session store with
`$mvn spring-boot:run -Phazelcast`.



=== MongoDB
Add `org.springframework.session:spring-session-data-mongodb` and
`spring-boot-starter-data-mongodb` dependencies to the project and make sure it is
configured properly (by default, a MongoDB instance with the default settings is expected
on your local box).

TIP: Run sample application using MongoDB session store using
`$mvn spring-boot:run -Pmongodb`.
13 changes: 13 additions & 0 deletions spring-boot-samples/spring-boot-sample-session/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,18 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>mongodb</id>
<dependencies>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>