Skip to content
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

MongoJackModule can't be configured with a custom ObjectMapper in OSGi #202

Closed
rakeshk15 opened this issue May 18, 2020 · 3 comments
Closed
Milestone

Comments

@rakeshk15
Copy link

Since MongoJackModule is in internal package therefore it is not accessible to register the custom ObjectMapper.

Basically this doesn't work in OSGi

MongoJackModule.configure(myObjectMapper);

One option would be to expose the internal package as well without any code change and this will be fully backward compatible. However, it breaks strong encapsulation which OSGi provides.

Fix/workaround - We just need to add one more package in maven-bundle-plugin

org.mongojack,org.mongojack.internal

if it is ok then I could provide a PR.

Thanks,
Rakesh

@rakeshk15
Copy link
Author

rakeshk15 commented May 18, 2020

or probably some other programmatic way provided by the JacksonMongoCollectionBuilder class itself where we just configure the MongoJackModule once with the custom ObjectMapper as we don't need to configure it per collection.

rakeshk15 added a commit to AdeptJ/adeptj-modules that referenced this issue May 25, 2020
rakeshk15 added a commit to AdeptJ/adeptj-modules that referenced this issue May 25, 2020
rakeshk15 added a commit to AdeptJ/adeptj-runtime that referenced this issue May 25, 2020
@rlodge
Copy link
Contributor

rlodge commented May 27, 2020

Would adding a static helper in org.mongojack that did the configuration work? I don't want to move the class and break backward compatibility.

e.g., something like:

org.mongojack.ObjectMapperConfigurer.configureObjectMapper(customObjectMapper)

@rlodge rlodge closed this as completed in 3928a63 May 27, 2020
@rakeshk15
Copy link
Author

I completely agree on maintaining the backward compatibility.

Yes, a helper in exported package will work and org.mongojack is exported as per the manifest headers.

@rlodge rlodge added this to the 4.0.1 milestone May 29, 2020
rlodge added a commit that referenced this issue Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants