-
Notifications
You must be signed in to change notification settings - Fork 41.5k
AutoConfiguration support for Data Mongo ReactiveGridFsTemplate #16467
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
AutoConfiguration support for Data Mongo ReactiveGridFsTemplate #16467
Conversation
… into autoConfiguration-support-mongo-reactiveGridFsTemplate
Test failure seems unrelated |
… into autoConfiguration-support-mongo-reactiveGridFsTemplate
… into autoConfiguration-support-mongo-reactiveGridFsTemplate
public ReactiveGridFsTemplate reactiveGridFsTemplate( | ||
ReactiveMongoDatabaseFactory reactiveMongoDbFactory, | ||
MappingMongoConverter mappingMongoConverter) { | ||
return new ReactiveGridFsTemplate(reactiveMongoDbFactory, mappingMongoConverter); |
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.
Ideally, we should configure ReactiveGridFsTemplate
with DataBufferFactory
to share potentially resources.
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.
ReactiveGridFsTemplate
constructor has 4 parameters:
-
DataBufferFactory
-
ReactiveMongoDatabaseFactory
-
MappingMongoConverter
-
bucket
What value of bucket should be in this case?
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.
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.
Thanks. I think the test has to be rewritten unless I am missing something.
@Test | ||
public void gridFsTemplateExists() { | ||
this.contextRunner.run((context) -> assertThat(context) | ||
.hasSingleBean(ReactiveMongoTemplate.class)); |
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 looks like you're checking for the wrong bean there.
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public DataBufferFactory dataBufferFactory() { |
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.
Can we flip those two methods? Required dependencies are defined before so I'd like to keep it that way.
* pr/16467: Polish "Add auto-configuration support for ReactiveGridFsTemplate" Add auto-configuration support for ReactiveGridFsTemplate
@ayudovin thanks for the feedback |
this enhancement