Skip to content

Support ConfigurationProperties BindHandler advisors #14745

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

Closed
philwebb opened this issue Oct 9, 2018 · 4 comments
Closed

Support ConfigurationProperties BindHandler advisors #14745

philwebb opened this issue Oct 9, 2018 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

philwebb commented Oct 9, 2018

Spring Cloud Stream have the concept of user supplied default values. The idea is that users may defined per-binder properties, but also "default" properties that should apply to every binder.

For example, the user might define the following:

spring.cloud.stream.default.content-type=text/plain
spring.cloud.stream.bindings.input.content-type=application/json

In this example, spring.cloud.stream.bindings.input.content-type would be application.json because it's explicitly defined and any other name (e.g. spring.cloud.stream.bindings.output.content-type) would be text/plain because the user has defined a default fallback.

Their existing code is quite complicated because it attempts to merge values manually, it also needs to call .bind twice. See EnvironmentEntryInitializingTreeMap and BindingServiceProperties for the existing implementation. What they really need is hooks that would allow them to introduce this concept without needing to do so much work themselves.

@philwebb philwebb added this to the 2.1.x milestone Oct 9, 2018
@philwebb philwebb self-assigned this Oct 9, 2018
@spencergibb
Copy link
Member

Spring cloud kubernetes has similar requirements.

@philwebb philwebb added type: enhancement A general enhancement for: team-attention An issue we'd like other members of the team to review labels Oct 9, 2018
@philwebb
Copy link
Member Author

philwebb commented Oct 9, 2018

/cc @olegz

@philwebb
Copy link
Member Author

philwebb commented Oct 9, 2018

One idea for how to do this is here, this test shows how it would work.

@snicoll
Copy link
Member

snicoll commented Oct 10, 2018

That rings a bell and we've discussed something similar at the team meeting. Relates to #7986 ?

@snicoll snicoll removed the for: team-attention An issue we'd like other members of the team to review label Oct 10, 2018
@philwebb philwebb changed the title Provide hooks for Spring Clould Stream default properties Support ConfigurationProperties BindHandler advisors Oct 10, 2018
@philwebb philwebb modified the milestones: 2.1.x, 2.1.0.RC1 Oct 11, 2018
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

No branches or pull requests

3 participants