Skip to content

Commit cffa095

Browse files
committed
Merge pull request #10374 from vpavic:improve-session-sample
* pr/10374: Add MongoDB support to Spring Session sample
2 parents f6cbee6 + a39ccc2 commit cffa095

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

spring-boot-samples/spring-boot-sample-session/README.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ supports multiple session store types, including:
66
* `Redis`
77
* `JDBC`
88
* `Hazelcast`
9+
* `MongoDB`
910
1011
1112
@@ -46,3 +47,14 @@ automatically configure the underlying `HazelcastInstance`.
4647

4748
TIP: Run sample application using Hazelcast session store with
4849
`$mvn spring-boot:run -Phazelcast`.
50+
51+
52+
53+
=== MongoDB
54+
Add `org.springframework.session:spring-session-data-mongodb` and
55+
`spring-boot-starter-data-mongodb` dependencies to the project and make sure it is
56+
configured properly (by default, a MongoDB instance with the default settings is expected
57+
on your local box).
58+
59+
TIP: Run sample application using MongoDB session store using
60+
`$mvn spring-boot:run -Pmongodb`.

spring-boot-samples/spring-boot-sample-session/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,18 @@
9494
</dependency>
9595
</dependencies>
9696
</profile>
97+
<profile>
98+
<id>mongodb</id>
99+
<dependencies>
100+
<dependency>
101+
<groupId>org.springframework.session</groupId>
102+
<artifactId>spring-session-data-mongodb</artifactId>
103+
</dependency>
104+
<dependency>
105+
<groupId>org.springframework.boot</groupId>
106+
<artifactId>spring-boot-starter-data-mongodb</artifactId>
107+
</dependency>
108+
</dependencies>
109+
</profile>
97110
</profiles>
98111
</project>

0 commit comments

Comments
 (0)