0

Application is built using spring boot.My application uses application.yaml for external config .But when i am trying to add below config in application.yaml , application fails to start with error as tomcat is not valid.However similar equivalent config I have tried in another application with application.propeties it works there.

server:
    port:8080
    tomcat:
      max-threads:500
      accept-count:500
      max-connections:10000
      min-spare-threads:500

2 Answers2

3

What is the springBoot version being used in the other application ?

FYI server.tomcat.max-threads is deprecated since Springboot 2.3, now use server.tomcat.threads.max in your Spring application.properties. https://docs.spring.io/spring-boot/docs/2.4.0/reference/html/appendix-application-properties.html#common-application-properties

Vali7394
  • 441
  • 5
  • 10
0

For me this seems to work in application.yaml

server:
    port: 8080
    tomcat: 
        max-threads: 500
        accept-count: 500
        max-connections: 10000
        min-spare-threads: 500

or this in application.properties

server.port = 8080
server.tomcat.max-threads = 500
server.tomcat.accept-count = 500
server.tomcat.max-connections = 10000
server.tomcat.min-spare-threads = 500

If it doesn't work, maybe there is an error in your dependencies?

Datz
  • 3,156
  • 3
  • 22
  • 50