Open wilkinsona opened 9 years ago
We need a way to also disable keys that are set in code that we don't own. Some thoughts:
@ConfigurationProperty(ignore=true)
@ConfigurationProperties(prefix="foo", excludeKeys=["foo.key", "foo.sub.bar"])
We could also add an "ignore" attribute to a property to make explicit that it should be ignored (in case of IDEs are trying to do smart things behind our back). In this case, we could ignore any property by simply registering with the ignore flag enabled; when we merge the additional meta-data with the current result, we override the flag.
Since this is quite an edge-case I think a new annotation might be better. I'm worried that more attributes on @ConfigurationProperties
might be confusing. We already have @NestedConfigurationProperty
so perhaps something like @IgnoredConfigurationProperty
which could be used on the class or a field.
Another option might be to try and extend the additional-spring-configuration-metadata
file.
This has come up again in 3.4 when some changes in Oracle UCP have resulted in some new properties appearing in the metadata:
spring.datasource.oracleucp.connection-wait-duration
spring.datasource.oracleucp.connection-wait-duration-in-millis
spring.datasource.oracleucp.hostname-resolver
We don't need both 1 and 2. 3 doesn't make sense at all as it requires an instance of HostnameResolver
which can't be created from properties (without custom conversion).
We discussed this today and we'd like to configure this in an external file (similar to additional-spring-configuration-metadata
). This would remove the need for any new public annotations. We'd keep the binder as it is and not try to prevent binding if someone did use an excluded name.
2027 adds support for configuring Bitronix and Atomikos' connection pools via the environment. These pools expose some properties that it doesn't make sense to expose to the environment such as
PoolDataSourceBean.failed
. We also want to hidePoolDataSource.className
as we configure that automatically to use ourDirectXADataSource