spring-session-data-mongodb icon indicating copy to clipboard operation
spring-session-data-mongodb copied to clipboard

Spring session in a multidatasource environment

Open visweshwar opened this issue 4 years ago • 0 comments

How to configure additional Datasource for Spring Session #96 #96

By default spring-session-data-mongodb assumes that the datasource in the project is exclusively used by spring session. If you have more than 1 dataSource, the very first bean gets elected to the primary Datasource for session. This is less than ideal. To account for this I've added an annotation to optionally elect the datasource of choice.

Expected behavior The MongoTemplate annotated with SpringSessionMongoOperations will be chosen as the Session Datasource

Actual behavior Currently the first Bean gets resolved as the MongoOperations of choice.

Steps to reproduce https://github.com/visweshwar/spring-session-multiple-mongo can reproduce the issue.

visweshwar avatar Jun 16 '20 11:06 visweshwar