-
-
Save brendonanderson/dfa699478fbcf50455891169157a26d2 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