DocumentReference does not work (after updating to 3.2) when mongodb-driver-reactivestreams is a dependency #4629
Labels
for: external-project
For an external project and not something we can fix
I'm uncertain if this belongs here or in spring-boot since it's potentially a springboot-autoconfiguration project issue as well (I'm also uncertain if this should actually be considered an issue at all -- but since it was a bit of a pain to figure out the root cause of after updating to spring-boot 3.2 I figured I'd put it here).
The project in question uses two relevant dependencies:
The project, in general, uses non-reactive mongo; reactivestreams are pulled in to utilize for changestream registration only. The following field would simply get set to NULL when reading from the (non-reactive) mongoTemplate.
This issue only started occurring after updating -- likely just due to low level changes causing a change in autoconfiguration orderings. Entities with a @DecumentReference field setup in this manner would simply start returning NULL (no proxy, or anything, was being configured):
After debugging the issue, I noticed that the MappingMongoConverter being autowired into the MongoTemplate contains a DbRefResolver of NoOpDbRefResolver.
This is occurring (and this is where I am uncertain if this should be logged her or to spring-autoconfigure) because MongoReactiveDataAutoConfiguration is being configured before MongoDatabaseFactoryDependentConfiguration.
Both autoconfiguration classes contain configuration to create a MappingMongoConverter bean:
I was able to work around the issue by copy-pasting the non-reactive bean definition above in my application's configuration.
The questions I have are:
The text was updated successfully, but these errors were encountered: