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
contextRereshed in KafkaListenerEndPointRegistry is set to true only if received ContextRefreshEvent, but in Spring SmartLifeCycle is triggered before ContextFreshEvent is sended out , so when smartLIfeCycle wants to start the containers, contextRefreshed will always be false, so my question is adding alwaysStartAfterRefresh this way ( #2301 ) will not start the containers even if context refreshed.
using 2.8.7 ,following code's output is still false, while true is expected
alwaysStartAfterRefresh means always start new registrations after the context has started.
When you register a container before the context is refreshed; the autoStartup property is honored. Refreshing the context does not start any containers that were registered before the refresh.
You have to manually start() such containers.
By default, the autoStartup property is ignored when registering new containers after the refresh and the container is started. alwaysStartAfterRefresh=false means always honor the autoStartup property.
/*** By default, containers registered for endpoints after the context is refreshed* are immediately started, regardless of their autoStartup property, to comply with* the {@link SmartLifecycle} contract, where autoStartup is only considered during* context initialization. Set to false to apply the autoStartup property, even for* late endpoint binding. If this is called after the context is refreshed, it will* apply to any endpoints registered after that call.* @param alwaysStartAfterRefresh false to apply the property.* @since 2.8.7*/publicvoidsetAlwaysStartAfterRefresh(booleanalwaysStartAfterRefresh) {
this.alwaysStartAfterRefresh = alwaysStartAfterRefresh;
}
contextRereshed in KafkaListenerEndPointRegistry is set to true only if received ContextRefreshEvent, but in Spring SmartLifeCycle is triggered before ContextFreshEvent is sended out , so when smartLIfeCycle wants to start the containers, contextRefreshed will always be false, so my question is adding alwaysStartAfterRefresh this way ( #2301 ) will not start the containers even if context refreshed.
using 2.8.7 ,following code's output is still false, while true is expected
The text was updated successfully, but these errors were encountered: