runWowLocal
fun runWowLocal(ports: LocalPorts = LocalPorts.of(System.getProperty(LocalPorts.PROPERTY)), partitions: Int = WowLocal.DEFAULT_PARTITIONS, services: WowLocal.Builder.() -> Unit)
Runs services as wowLocal starts them, from a main function: it prints WowLocal.readyLine once every service listens, and stops them when the JVM exits. With the system property wow-local.exit-on-stdin-eof set to true, the JVM exits when its standard input closes, so a process that started it, a test of a web front end say, never leaves it running. A service that fails to start makes it print why and exit with status 1.
fun main() = runWowLocal {
service<OrderingServer>("eshop-ordering-service", listOf("eshop-ordering"), 8083, 9093)
service<BasketServer>("eshop-basket-service", listOf("eshop-basket"), 8082, 9092)
}Content copied to clipboard