spring-session-data-mongodb
spring-session-data-mongodb copied to clipboard
Spring session in a multidatasource environment
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.