Annotation Interface EnableMongoWebSession
@Retention(RUNTIME)
@Target(TYPE)
@Documented
@Import(ReactiveMongoWebSessionConfiguration.class)
public @interface EnableMongoWebSession
Add this annotation to a
@Configuration
class to configure a MongoDB-based
WebSessionManager
for a WebFlux application. This annotation assumes a
ReactorMongoOperations
is defined somewhere in the application context. If not,
it will fail with a clear error messages. For example:
@Configuration(proxyBeanMethods = false)
@EnableMongoWebSession
public class SpringWebFluxConfig {
@Bean
public ReactorMongoOperations operations() {
return new MaReactorMongoOperations(...);
}
}
- Since:
- 2.0
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe collection name to use.int
The maximum time a session will be kept if it is inactive.
-
Element Details
-
maxInactiveIntervalInSeconds
int maxInactiveIntervalInSecondsThe maximum time a session will be kept if it is inactive.- Returns:
- default max inactive interval in seconds
- Default:
- 1800
-
collectionName
String collectionNameThe collection name to use.- Returns:
- name of the collection to store session
- Default:
- "sessions"
-