Hi there,
I have my logic like so, after 3 compose, I have to finally update a table to setDate. But for some reason it takes around 4 mins as you can see in the console log below. I will appreciate any help!!
public Future<String> startPrintJob(int jobID, RoutingContext context) {
LOG.info("-----INside startPrint() method-----");
LabelParameterContext labelParameterCtx = new LabelParameterContext();
return jobDao.getJob(jobID, context)
.compose(job -> productDao.getLabelParameters(job, context))
.compose(labelParameters -> {
labelParameterCtx.setLabelParameters(labelParameters);
return jobDao.getJobParentChildForPrint(jobID, context, false, labelParameters);
})
.compose(parentChildSerials -> {
LOG.debug(" Future Returned Job's Parent-Child to Print: ");
//LOG.debug(" ZZZZZ::: "+parentChildSerials);
JsonObject labelParameters = labelParameterCtx.getLabelParameters();
try {
prepareSerialForPrint(parentChildSerials, labelParameters);
} catch (UnknownHostException e) {
e.printStackTrace();
} //Pass Here
return Future.succeededFuture("Job Completed Successfully!!!!");
})
.onFailure(error -> {
LOG.debug("startTest() Failed: ", error);
})
.onSuccess(server -> {
LOG.debug("Finished !!");
//LOG.debug(server.encodePrettily());
jobDao.setJobFinishedDate(jobID);
});
}//startPrintJob()
CONSOLE LOG
2022-07-02 18:47:52.077+0430 [vert.x-eventloop-thread-1] DEBUG com.ali.dao.JobDao - Tuple for Parent UID values: [2022-07-02 18:47:52,11]
2022-07-02 18:47:52.078+0430 [vert.x-eventloop-thread-1] DEBUG com.ali.job.PrintJobHandler - parentChildSerials Future{result=Job Completed Successfully!!!!}
2022-07-02 18:51:43.735+0430 [vert.x-eventloop-thread-1] DEBUG com.ali.dao.JobDao - Updated job table's finished_on column!!!!!!!!!!!!!!!!!!!!!!!!!