spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Spring AI cannot be integrated with spring-boot-starter-Webflux and spring-boot-starter-security

Open ExxXyz opened this issue 1 year ago • 1 comments

Because Spring AI relies on spring-boot-starter-web, @EnableWebFlux conflicts with @EnableWebMvc. Is there any good way to solve this problem?

ExxXyz avatar Jul 21 '24 02:07 ExxXyz

you can resolve the conflict between @EnableWebFlux and @EnableWebMvc by choosing one over the other based on your application requirements. Here are some options to help you navigate this situation: If you are building a reactive application, you should use @EnableWebFlux. Make sure to exclude any dependencies that rely on spring-boot-starter-web and its servlet-based stack. if you are building a non reactive(standard servlet-based), you should use @EnableWebMvc. In this case, remove the spring-boot-starter-webflux dependency and use spring-boot-starter-web.

if you want to use both reactive and non reactive endpoints in the application (which not recommend). You can create conditional configuration based on specific profiles.

nithin9700 avatar Aug 01 '24 07:08 nithin9700

Hello @ExxXyz - hopefully the response from @nithin9700 answered your question. Please let us know if you would like to reopen for any particular follow ups. Thank you.

csterwa avatar Sep 09 '24 18:09 csterwa