save topology description to disk

This commit is contained in:
Adam 2022-04-23 21:56:43 +02:00
parent 2c383041b5
commit 0d81650400

View file

@ -10,6 +10,7 @@ import java.time.Duration
import java.util.Properties import java.util.Properties
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.cancellation.CancellationException import kotlin.coroutines.cancellation.CancellationException
import kotlin.io.path.Path
import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
@ -92,10 +93,17 @@ internal class KafkatorioTopology(
}) })
val description: TopologyDescription = topology.describe() val description: TopologyDescription = topology.describe()
val descFile = Path("./build/$appId.txt").toFile().apply {
parentFile.mkdirs()
if (!exists()) createNewFile()
writeText(description.toString())
}
println( println(
""" """
|---------------- |----------------
|$appId |$appId - ${descFile.canonicalPath}
|$description |$description
|---------------- |----------------
""".trimMargin() """.trimMargin()