Search code examples
spring-boothibernatespring-mvcmicroservicesspring-cloud

Which is the best way for the routs uri in spring boot except zuul and spring cloud gateway


I am upgrading the spring boot 1.3.7.RELEASE to 2.5.12 and spring framework 5.3.18 in my spring boot microservice based project we have upgrade successfully with all service except gateway service when i am unabling t add zuul dependency because its maintenance mode that why we have implemented spring cloud gateway then i am getting below issue.

***************************
APPLICATION FAILED TO START
***************************

Description:

Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.

Action:

Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

Wwhat we need to do implementation for best way?


Solution

  • We have fix the routing issue using the spring cloud gateway.

    Please add dependency in the pom.xml

    <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> </dependency>

    bootstrap.yml

    spring:main:web-application-type:reactive

    Thanks you guys for supporting.