Local Pub/Sub or doThreadInvoke

I need your advise regarding asynchronous invocation of a flow service. Let me put this across with an example.

Flow service F1 has to invoke two services A1 and A2. The service A1 can be invoked asynchronously and the output of A1 is not required or immaterial to go ahead with execution of service A2. The services A1 and A2 lie on the same IS(may be under different packages).

Under these circumstances, I can make service F1 publish a document which will be subscribed by A1. The publish can be a local publish. The alternative approach is that I can use doThreadInvoke to achieve the same functionality.

What is the best way of implementing this and why?

Please help.

Best Regards
Sivaraj Lenin

I think it depends on what service A1 does and how often it would be invoked. Since you don’t want to wait for it to complete, I’m guessing there might be some chance that it would fail or time out. In that case you might be better off going the local publish route, which would avoid any problems with threads that never die off.


Thanks Tim for your quick response.

I’m wondering on a broader perspective about asynchronously invoking flow services. The service being executed asynchronously must be reprocessed if there was an error.

If I opt for local pub/sub, the reprocessing happens through trigger whenever the service throws an exception.

In case of doThreadInvoke as well, I can make the service A1 to log the pipeline whenever there was an error (through audit settings for the service) and therefore, it can be resubmitted later.

Please advise.

Sivaraj Lenin