You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Environment instance in the SCS parent and child contexts are ApplicationServletEnvironment and SystemEnvironmentPropertySource respectively, which causes the property values they obtain to be inconsistent with expectations, for example: for a property spring.cloud.azure.eventhubs.connection-string, if configuring SPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING, then it cannot be got by env in sub context, see the logic from checkPropertyName Describe the issue
I can see the parent context using SystemEnvironmentPropertyMapper to map candidate to find the property value; but the sub context does not leverage the mapper,
To Reproduce
Steps to reproduce the behavior:
Base on Kafka binder usage, registry a configuration for sub context, such as spring.cloud.stream.binders.kafka.environment.spring.main.sources=com.reproducer.MyConfig
Define a connectionString bean with the condition @ConditionalOnProperty("a.b.connection-string")
Configure an environment variable, A_B__CONNECTIONSTRING=connection-string-value
Run the app, the connectionString bean is not registered into sub context.
Version of the framework Spring Boot 3.3.5 & Spring Cloud Stream 4.1.3 Expected behavior To get same candidates against SystemEnvironmentPropertyMapper mapped. Screenshots
Additional context
N/A
The text was updated successfully, but these errors were encountered:
The SystemEnvironmentPropertyMapper is not a s-c-stream class and comes from boot.
That said, indeed there are few few workarounds that we had to do to deal with parent/child context and our current mechanisms may work, but it would be preferable if you had a reproducible sample. You can create a small project and push it to github somewhere.
The Environment instance in the SCS parent and child contexts are
ApplicationServletEnvironment
andSystemEnvironmentPropertySource
respectively, which causes the property values they obtain to be inconsistent with expectations, for example: for a propertyspring.cloud.azure.eventhubs.connection-string
, if configuringSPRING_CLOUD_AZURE_EVENTHUBS_CONNECTIONSTRING
, then it cannot be got by env in sub context, see the logic from checkPropertyNameDescribe the issue
I can see the parent context using SystemEnvironmentPropertyMapper to map candidate to find the property value; but the sub context does not leverage the mapper,
To Reproduce
Steps to reproduce the behavior:
spring.cloud.stream.binders.kafka.environment.spring.main.sources=com.reproducer.MyConfig
Version of the framework Spring Boot 3.3.5 & Spring Cloud Stream 4.1.3
Expected behavior To get same candidates against
SystemEnvironmentPropertyMapper
mapped.Screenshots
Additional context
N/A
The text was updated successfully, but these errors were encountered: