Open
Description
Setting spring.main.lazy-initialization: true
effectively disables the spring.reactor.context-propagation: AUTO
, as the ReactorAutoConfiguration
1 is never instantiated during the application startup. Turning on eager initialization alleviates this problem, which leads me to believe that this particular setup was overlooked when the AutoConfiguration
class what added. Hence, I created this issue, even though the text reads more like a question.
We are currently doing the following
@AutoConfiguration
@ConditionalOnClass(Hooks.class)
@EnableConfigurationProperties(ReactorProperties.class)
@Lazy(false)
public class EagerReactorAutoConfiguration {
EagerReactorAutoConfiguration(ReactorProperties properties) {
if (properties.getContextPropagation() == ReactorProperties.ContextPropagationMode.AUTO) {
Hooks.enableAutomaticContextPropagation();
}
}
}
This is not elegant at all and I am not super sure if there is a way of forcing eager auto configuration for such cases (or if this should be rather fixed at Spring Boot level).
Cheers!