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 DeprecatedPropertyWarningConfig
    
                        

    Configuration for deprecated property warning behavior.

    This configuration class uses var for the Boolean property due to production requirements discovered when using @Configuration classes 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. Using val causes: "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-logging

    Key Distinction: Pure @ConfigurationProperties data classes can use val with constructor binding, but @Configuration + @ConfigurationProperties classes need var for CGLIB proxy compatibility.

    # Environment variable binding (requires var with @Configuration classes)
    export EMBABEL_AGENT_PLATFORM_MIGRATION_WARNINGS_INDIVIDUAL_LOGGING=true
    • ⚠️ Scalar types with @Configuration: var required for CGLIB proxy compatibility

    • ❌ Complex types (List, Map): var required for reliable environment variable binding

    • ✅ Constructor Binding: Kotlin data classes automatically use constructor binding for val

    • ✅ Setter Binding: Properties with var use setter-based binding

    Production Decision: Uses var due to CGLIB proxy requirements with @Configuration annotation.

    • Constructor Detail

      • DeprecatedPropertyWarningConfig

        DeprecatedPropertyWarningConfig()
    • 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.