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
DefaultDestinationTopicResolver closes the container on ContextRefreshedEvent.
When using Spring Cloud, specifically FeignClient, some components might create a child application context that spring cloud maintains.
See 7.2 - https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html
"A central concept in Spring Cloud’s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the @FeignClient annotation. Spring Cloud creates a new ensemble as an ApplicationContext on demand for each named client using FeignClientsConfiguration."
This child application contexts are going to be an ApplicationEvent source for the DefaultDestinationTopicResolver component, which is defined as an ApplicationEvent listener.
DefaultDestinationTopicResolver is intended to close the container after a ContextRefreshedEvent.
When there are child application contexts (ContextRefreshedEvent emitters) we end up having some inconsistencies in the DefaultDestinationTopicResolver context lifecycle.
…loud Environment (#1962)
* GH-1961: Close container on ContextRefreshEvent only if event source is the same application context.
* GH-1961: Updated Javadoc
…loud Environment (#1962)
* GH-1961: Close container on ContextRefreshEvent only if event source is the same application context.
* GH-1961: Updated Javadoc
garyrussell
added a commit
to garyrussell/spring-kafka
that referenced
this issue
Sep 27, 2021
DefaultDestinationTopicResolver closes the container on ContextRefreshedEvent.
When using Spring Cloud, specifically FeignClient, some components might create a child application context that spring cloud maintains.
See 7.2 - https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html
"A central concept in Spring Cloud’s Feign support is that of the named client. Each feign client is part of an ensemble of components that work together to contact a remote server on demand, and the ensemble has a name that you give it as an application developer using the @FeignClient annotation. Spring Cloud creates a new ensemble as an ApplicationContext on demand for each named client using FeignClientsConfiguration."
This child application contexts are going to be an ApplicationEvent source for the DefaultDestinationTopicResolver component, which is defined as an ApplicationEvent listener.
DefaultDestinationTopicResolver is intended to close the container after a ContextRefreshedEvent.
When there are child application contexts (ContextRefreshedEvent emitters) we end up having some inconsistencies in the DefaultDestinationTopicResolver context lifecycle.
Pull Request: #1962
Affects Version(s): 2.7.2
The text was updated successfully, but these errors were encountered: