Skip to content

MongoSession should be public #2217

Closed
@EugenMayer

Description

@EugenMayer

With #2170 MongoSession was made package private.

The problem with that is, that if someone, as we do, implements AbstractMongoSessionConverter to support custom convert implementations (for DBObject and back), it becomes no longer possible.

Interestingly AbstractMongoSessionConverter is public and abstract, so it is intended to implement it. In addition, convert is protected, not private. So it is intended that one can override it.

But due to MongoSession being package private this is no longer possible and i'am yet unware on how to workaround this limitation.

AFAIR with this new limitation spring session requires, that the MongoDB session strucuture is exactly what the developers first though of, without any ability to adopt it.

That being said, it's odd to see that at the same time AbstractMongoSessionConverter being abstract and not implementing convert at all, this detail is "left open". On can either use JacksonMongoSessionConverter or JdkMongoSessionConverter and that's about it.

Could someone explain why this limitation is important / what the rational is introducing this limitation in the first place?
Also i would love to understand why this public to package private change is by no means reflected in the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#embedded-mongodb changlog guide? Is it really so unimportant?

Thank you!

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions