2

I have a Spray app that will be ultimately deployed to an array of Apache Tomcat servers.

During development it would be convenient to be able to launch multiple instances of Tomcat running the app on different ports from sbt.

The checkbox item "Running multiple container instances in a single SBT project" in this issue suggests that it is supported but I can't seem to find a step-by-step procedure to get it set up in my project.

Can anyone confirm if this is possible at all, and if so how to configure it?

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
henry
  • 5,923
  • 29
  • 46
  • "Running multiple container instances in a single SBT project" originally referred to something fairly different from your use case, and was ultimately tossed out as a requirement. That said, your use case is pretty interesting, and I think support for it can be added, so I [created an issue](https://github.com/earldouglas/xsbt-web-plugin/issues/191) for it. – earldouglas Oct 01 '14 at 17:13

1 Answers1

1

This is now supported in xsbt-web-plugin version 3.0.0.

You can configure your webapp to launch in multiple containers by setting containerScale in your sbt configuration:

build.sbt:

containerScale := 5

This configures <container>:start, <container>:quickstart, and <container>:debug to fire up five instances of the container, and <container>:stop to tear them all down.

earldouglas
  • 13,265
  • 5
  • 41
  • 50