Hi all
We're using ivy 6.3, and have face the problem that we implement a restfulAPI by java code, when we trigger the callable subprocess from it. After callablesub is finished, it will remain a zombie task.
Why i need to call ivy subprocess from api?
Answer: i need to call ivy.repo() to persist my data then response the id. This api can't be called in restful.
Here is my callable subprocess:
and it's the code of api:
@Path("{applicationName}/individualch")
@Produces(MediaType.APPLICATION_JSON)
public class IndividualchApi {
/**
* This API is used by third party application when it want to call
* to create dossier Response message is cobId
* @param provider
* @param externalId
* @param sobDossier
* @return
*/
@POST
@Path("/dossiers")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response createIndividualCHDossier(@NotNull String provider, @NotNull String externalId, SobDossier sobDossier) {
if (StringUtils.isBlank(provider) || StringUtils.isBlank(externalId) || sobDossier == null) {
return Response.status(Status.BAD_REQUEST).entity(new ResponseExceptionMessage()
.errorCode(DossierCreationServiceExceptionType.BAD_REQUEST.getUniqueCode().toString())
.message("Invalid params")).build();
}
return new CreateDossierHandlerService().createIndividualCHDossier(provider, externalId, sobDossier);
}
}
And here is the way we trigger subprocess from service:
SubProcessCallResult callResult = SubProcessCall.withPath(CREATE_DOSSIER_HANDLER_PROCESS_NAME)
.withStartSignature("createDossier(String,String,SobDossier)")
.withParam(PARAM_PROVIDER, provider).withParam(PARAM_EXTERNAL_ID, externalId)
.withParam(PARAM_SOB_DOSSIER, sobDossier)
.call();
My Question:
- Is it a good solution to go? I actually can't call ivy.repo() inside my service. How can we prevent this kind of zomebie task?
- If we can't prevent zombie task, how ivy handle this kind of task? Does ivy clean it up automatically?
Thanks all
asked
27.10.2017 at 01:55
trungdv
(suspended)
accept rate:
52%