Class AsyncEventService
The processor look up the workItem and starts a processing life cycle.
The AsyncEventService is called only by the AsyncEventScheduler which is implementing a ManagedScheduledExecutorService.
To prevent concurrent processes to handle the same workitems the batch process uses a Optimistic lock strategy. After fetching new event log entries the processor updates the eventLog entry in a new transaction and set the topic to 'batch.process.lock'. After that update we can be sure that no other process is dealing with these entries. After completing the processing step the eventlog entry will be removed.
To avoid ad deadlock the processor set an expiration time on the lock, so the lock will be auto-released after 1 minute (batch.processor.deadlock).
- Version:
- 1.0
- Author:
- rsoika
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onProcess
(ProcessingEvent processingEvent) The observer method verifies if the current task contains a AsyncEvent definition.void
The method lookups for batch event log entries and processed workitems in a batch process.
-
Constructor Details
-
AsyncEventService
public AsyncEventService()
-
-
Method Details
-
onProcess
The observer method verifies if the current task contains a AsyncEvent definition.- Throws:
ModelException
-
processEventLog
public void processEventLog()The method lookups for batch event log entries and processed workitems in a batch process.Each eventLogEntry is cached in the eventCache. The cache is cleared from all eventLogEntries not part of the current collection. We can assume that the event was succefully processed by the ArchiveHandler
- Throws:
ArchiveException
-