Class DeprecatedPropertyWarningConfig
-
- All Implemented Interfaces:
@Configuration()@ConfigurationProperties(value = "embabel.agent.platform.migration.warnings")@ConditionalOnProperty(name = {"embabel.agent.platform.migration.warnings.enabled"}, havingValue = "true", matchIfMissing = true) public final class DeprecatedPropertyWarningConfigConfiguration for deprecated property warning behavior.
This configuration class uses
varfor the Boolean property due to production requirements discovered when using@Configurationclasses with CGLIB proxying.CGLIB Proxying Requirement: When using
@Configuration(not just@ConfigurationProperties), Spring Boot creates CGLIB proxies that require setters for environment variable binding, even for scalar types. Usingvalcauses:"No setter found for property: individual-logging"Production Error:
Failed to bind properties under 'embabel.agent.platform.migration.warnings' Property: embabel.agent.platform.migration.warnings.individual-logging Value: "true" Origin: System Environment Property "EMBABEL_AGENT_PLATFORM_MIGRATION_WARNINGS_INDIVIDUAL_LOGGING" Reason: java.lang.IllegalStateException: No setter found for property: individual-loggingKey Distinction: Pure
@ConfigurationPropertiesdata classes can usevalwith constructor binding, but@Configuration+@ConfigurationPropertiesclasses needvarfor CGLIB proxy compatibility.# Environment variable binding (requires var with @Configuration classes) export EMBABEL_AGENT_PLATFORM_MIGRATION_WARNINGS_INDIVIDUAL_LOGGING=true⚠️ Scalar types with @Configuration:
varrequired for CGLIB proxy compatibility❌ Complex types (List, Map):
varrequired for reliable environment variable binding✅ Constructor Binding: Kotlin data classes automatically use constructor binding for
val✅ Setter Binding: Properties with
varuse setter-based binding
Production Decision: Uses
vardue to CGLIB proxy requirements with @Configuration annotation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDeprecatedPropertyWarningConfig.Companion
-
Field Summary
Fields Modifier and Type Field Description private BooleanindividualLoggingpublic final static DeprecatedPropertyWarningConfig.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description DeprecatedPropertyWarningConfig()
-
Method Summary
Modifier and Type Method Description final BooleangetIndividualLogging()Whether to enable individual warning logging. final UnitsetIndividualLogging(Boolean individualLogging)Whether to enable individual warning logging. -
-
Method Detail
-
getIndividualLogging
final Boolean getIndividualLogging()
Whether to enable individual warning logging. Enabled by default for maximum visibility during migration periods. When true, each deprecated property usage is logged immediately. When false, only aggregated summary is logged.
-
setIndividualLogging
final Unit setIndividualLogging(Boolean individualLogging)
Whether to enable individual warning logging. Enabled by default for maximum visibility during migration periods. When true, each deprecated property usage is logged immediately. When false, only aggregated summary is logged.
-
-
-
-