Web / Apache OFBiz Interview questions
Explain the execution flow of an asynchronous service call in OFBiz?
An async call (dispatcher.runAsync) queues the service to run on a separate thread or, if declared persistent, as a row in the JobSandbox table picked up later by the Job Scheduler - the caller doesn't wait and gets no direct return value.
This is the pattern for fire-and-forget work: sending a confirmation email after an order is placed, or a bulk recalculation that shouldn't block the user's request.
- Caller invokes
runAsync, optionally marking the callpersist="true". - If persistent, a job record is written to
JobSandboxwith its parameters serialized, surviving a server restart. - A Job Poller thread picks up due jobs and hands them to the Service Engine exactly like a synchronous call internally.
- Success or failure is recorded on the job record rather than returned to the original caller.
Because failures aren't surfaced synchronously, async services are expected to log clearly and, where it matters, write their own status or notification records so failures stay visible.
More Related questions...