-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Consistent property prefixes for Spring Session MongoDB and Spring Data MongoDB #9625
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
Conversation
Looks great! |
See also #9552 (comment) with some discussion about how we should deal with Spring Session now that it has been split up. |
Integer timeout = sessionProperties.getTimeout(); | ||
if (timeout != null) { | ||
setMaxInactiveIntervalInSeconds(timeout); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a suggestion, to be a bit more java 8 and fluent, you might use: Optional.ofNullable(sessionProperties.getTimeout()).ifPresent(this::setMaxInactiveIntervalInSeconds);
Sorry, @vpavic. I'd missed that we had this PR for #9552. What I've done is largely the same as what you'd proposed here. One notable difference is that I've kept the store type as Mongo rather than MongoDB. That was purely to avoid a change from what we had in 1.5. If the Spring Session team feel that we should go with the DB suffix that I'm not opposed to doing so. |
I've rebased the changes from this PR on top of changes from c00a42f. Basically the only difference is naming concerns from bullet no. 2 of the opening comment:
Those could still be worth getting in, both for reasons above and consistency with |
Reopening to consider the |
While the module is now named |
OK, I agree that class names should stay as they are. But my primary concern was actually |
Hmm, you make a compelling point regarding the property prefix. Things are inconsistent at the moment and I don't like that. |
In summary, our configuration property prefix for Spring Data MongoDB is currently (in both 1.5.x and master) I think we should make this consistent. The proposal here is to align by changing the Spring Session-related names. Specifically, the prefix would become |
Thanks for reconsidering this. I've update the PR to remove the class renaming noise - it should now more clearly reflect the changes that are under consideration. |
@@ -427,8 +427,8 @@ content into your application; rather pick only the properties that you need. | |||
spring.session.jdbc.schema=classpath:org/springframework/session/jdbc/schema-@@platform@@.sql # Path to the SQL file to use to initialize the database schema. | |||
spring.session.jdbc.table-name=SPRING_SESSION # Name of database table used to store sessions. | |||
|
|||
# SPRING SESSION MONGO ({sc-spring-boot-autoconfigure}/session/MonogoSessionProperties.{sc-ext}[MongoSessionProperties]) | |||
spring.session.mongo.collection-name=sessions # Collection name used to store sessions. | |||
# SPRING SESSION MONGODB ({sc-spring-boot-autoconfigure}/session/MongoDbSessionProperties.{sc-ext}[MongoDbSessionProperties]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should stay as MongoSessionProperties
+1 to that. Sorry, we discussed this before and didn't catch that inconsistency either :( |
Thanks, @vpavic. I've merged this into master. |
This resolves #9552.
Changes are mostly a revert of 33dd9d6 adopted with ones from #9554. There are however a few other changes:
spring-session-mongodb.version
which is currently set to2.0.0.BUILD-SNAPSHOT
(next milestone should be2.0.0.M2
)mongodb
to be consistent with naming (module was previously namedspring-session-data-mongo
, now isspring-session-data-mongodb
)SessionAutoConfigurationMongoTests
Depending on release date of Spring Session MongoDB
2.0.0.M2
this could be targeted at Boot's2.0.0.M3
(#9552 is currently targeted at2.0.0.M4
)./cc @rwinch @gregturn