16

I want to load two servlet containers with embedded tomcat configuration on different ports with Spring Boot.

Does anyone know how to achieve this?

Peter Bartels
  • 1,474
  • 1
  • 12
  • 20

1 Answers1

19

It should be simple: just create as many ApplicationContexts of type EmbeddedWebApplicationContext as you need and give them each an EmbeddedServletContainerFactory with a different port. Example here where the two contexts are parent and child, but that's not a necessary part of the setup.

Dave Syer
  • 56,583
  • 10
  • 155
  • 143