0

After deploying the gateway war file on tomcat not able to access it.

application.yml file setup

server:
  port: 9000
  servlet:
    context-path: /gateway

spring:
  cloud:
    gateway:
      routes:
      - id: mysqlservice
        uri:  http://localhost:8080
        predicates:
        - Path= /gateway/mysql/**
        filters:
        - StripPrefix=1     
        
        
      - id: xyzservice
        uri:  http://localhost:8080
        predicates:
         - Path= /gateway/xyz/**    
        filters:
        - StripPrefix=1     
             
        
      - id: lightservice
        uri:  http://localhost:8080
        predicates:
         - Path= /gateway/light/**    
        filters:
        - StripPrefix=1     
        
    

The above configuration works fine when I run it through the normal spring boot JAR file

Ex. http://localhost:9000/gateway/mysql/mysqlapi/test

when it deployed on the tomcat server that time I am not able to access it

Ex. Ex. http://localhost:8080/gateway/mysql/mysqlapi/test

So how can i access it from tomcat server?

1 Answer 1

3

You can’t as it is not supported:

Spring Cloud Gateway requires the Netty runtime provided by Spring Boot and Spring Webflux. It does not work in a traditional Servlet Container or when built as a WAR.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the help, I'll try with Netty runtime provided by Spring Boot and Spring Webflux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.