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

Allow easy customization of EmbeddedMongo DownloadConfig #15496

Closed
wants to merge 1 commit into from

Conversation

mgmeiner
Copy link

This PR introduces 2 new configuration properties to allow easy customization of the DownloadPath of a mongodb.

  • spring.mongodb.embedded.download.path = custom download url
  • spring.mongodb.embedded.download.user-agent = custom User-Agent HTTP-Header for the download request

We need this due to some special security rules in our company which prevents us from downloading the binaries directly from mongodb. With this PR it is possible to easy override the default download-path and point it to our own server.
Also it is now possible to easy create a completely custom DownloadConfig by simply providing a bean which implements IDownloadConfig

@pivotal-issuemaster
Copy link

@mgmeiner Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@mgmeiner Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 19, 2018
@wilkinsona
Copy link
Member

@mgmeiner Thanks very much for opening your first contribution to Spring Boot. Given that, as far as we know, you requirements are fairly unusual, I wonder if the new properties are justified. To reduce the surface area of the changes I think it might be better to only offer a bean-based solution. That could either be the conditional IDownloadConfig bean that you have proposed or we could offer a DownloadConfigBuilderCustomizer callback interface. Beans implementing that interface would then be called by EmbeddedMongoAutoConfiguration prior to creating the download config. Unlike providing an IDownloadConfig bean, this would avoid the need for user code to deal with configuring the progress listener. What do you think?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Dec 19, 2018
@mgmeiner
Copy link
Author

@wilkinsona I like your idea on this and you're right: introducing new properties for the download config which is indeed a very specific case - is not justified. I updated the PR and implemented it how you suggested. I named the Customizer EmbeddedMongoDownloadConfigBuilderCustomizer to match the naming of the other classes in the package.

@mgmeiner
Copy link
Author

not sure why the tests are failing.. Locally all tests have passed without error

@wilkinsona
Copy link
Member

That's a known issue that may be caused by an underlying bug in the JDK. I'd like Embedded Mongo to retry in that case, but the suggestion didn't get any traction.

@wilkinsona wilkinsona removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Dec 20, 2018
@wilkinsona wilkinsona added this to the 2.2.x milestone Dec 20, 2018
@wilkinsona wilkinsona added the type: enhancement A general enhancement label Dec 20, 2018
@snicoll snicoll changed the title allow easy customization of EmbeddedMongo DownloadConfig Allow easy customization of EmbeddedMongo DownloadConfig Jan 2, 2019
@snicoll snicoll self-assigned this Jan 2, 2019
@snicoll snicoll closed this in 6ba1f40 Jan 2, 2019
snicoll added a commit that referenced this pull request Jan 2, 2019
* pr/15496:
  Polish "Allow easy customization of EmbeddedMongo DownloadConfig"
  Allow easy customization of EmbeddedMongo DownloadConfig
@snicoll snicoll modified the milestones: 2.2.x, 2.2.0.M1 Jan 2, 2019
@snicoll
Copy link
Member

snicoll commented Jan 2, 2019

@mgmeiner thank you for making your first contribution to Spring Boot. This is now merged in master with a polish commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants