Created
October 9, 2017 01:17
-
-
Save anonymous/f7e3976ceb9d4d0005ef244f66b60ecc to your computer and use it in GitHub Desktop.
Gradle SpawnProcessTask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task startServer(type: SpawnProcessTask) { | |
doFirst { | |
kafkaEmbedded = new KafkaEmbedded(1, true, 1, 'output-topic') | |
kafkaEmbedded.before() | |
bootPort = availablePort() | |
command "java -Dserver.port=${bootPort} -Dspring.kafka.producer.bootstrap-servers=${kafkaEmbedded.getBrokersAsString()} -Dspring.kafka.consumer.group-id=func-test -jar ${projectDir}/build/libs/emb-kafka-${version}.jar" | |
ready 'Started EmbKafkaApplication' // looks for this text to indicate process has started | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment