Create a spring boot application with multiple child contexts

倾然丶 夕夏残阳落幕 提交于 2019-12-04 23:49:45
ESala

The child(...) method creates and returns another SpringApplicationBuilder, so when you call that second child(...) method, you are not instantiating a brother for the child, you are making a child on the first child, which makes the parent become a grandpa.

Jokes aside, have a look at the sibling(...) method which allows to create another context with the same parent.

You can also check out the source to see exactly what is going on.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!