-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Description
We are using an ApplicationContext hierarchy in our Spring Boot application. Each child application has their own webserver using a unique port, that is configured through a custom child specific properties file. This works fine in spring boot 2.5. However, after upgrading to 2.6(.2), the single parent context contains already a ServerProperties instance, causing all child component to reuse that one instead of creating their own, breaking our configuration.
After some digging, the problem seems to be a change in WebSessionIdResolverAutoConfiguration. Since 2.6, that one requires ServerProperties, causing it to be added to the root context.
As a workaround, we have explicitly removed the WebSessionIdResolverAutoConfiguration from our root context (using EnableAutoConfiguration(exclude={WebSessionIdResolverAutoConfiguration.class})).
I see a similar issue was raised and fixed when migrating from 2.2 to 2.3 (#21789).
Our current way of providing different servers per child component relies on the assumption that the parent context does not contain an instance of ServerProperties. This seems to be a brittle assumption. Is there a better (more stable) approach to achieve what we are trying to do ?