It's hard to tell from your description what you are trying to achieve.
You can submit a Spark-job directly from Vert.x and wait for a result. For that you have to use executeBlocking. Use a WorkerExecutor as these can block for quite some time (minutes, hours, days, depending on what your job is doing) to prevent these jobs from impacting Vert.x itself:
(All the following is pseudo-code I just scrabbled together out of my head ...)
Let's take a small Spark-job:
class SparkJob() extends Serializable{
def getCount() :Long = {
val conf = new SparkConf()
.setAppName("wordCounter")
val sc = new SparkContext(conf)
val file = sc.textFile(filePath)
file.filter(_.contains("wtf")).count()
}
}
Using this job inside vert.x could look like this:
vertx.createSharedWorkerExecutor("sparkWorker").executeBlocking(h => {
val job = new SparkJob
return job.getCount()
}, res => {<useresult>})
Did that help?