|Caching Data with GemFire XD / Handling DML Events Asynchronously|
An AsyncEventListener instance is serviced by its own dedicated thread in which a callback method is invoked. Events that correspond to DML operations are placed in an internal queue, and a single thread dispatches a batch of events at a time to the user-implemented callback class in first in, first out (FIFO) order. The frequency of dispatching events to the listener is governed by the configuration of the AsyncEventListener in GemFire XD.
|Type of Event||Object of EVENT.Type enumeration. This can be AFTER_INSERT, AFTER_UPDATE, AFTER_DELETE, BEFORE_DELETE, BEFORE_INSERT, BEFORE_UPDATE, BULK_DML, or BULK_INSERT depending upon the type of CRUD operation.|
|Schema and Table Name||The schema and table name for the current operation.|
|Old Row||A result set of column values representing the old row that is being updated.|
|New Row||A result set of column values representing the new rows that are being inserted or updated.|
|Table MetaData||Information about the type, properties, and positions of the columns being returned.|
|Primary Key||A result set representing the primary key columns of the changed rows.|
Use the information provided in the list of events to perform the work of your listener implementation. Your processEvents method should return TRUE if it successfully processes all of the events, in which case GemFire XD deletes the processed events from the queue. Return FALSE if if you are unable to successfully process the events and you want GemFire XD to preserve and re-send the events, rather than deleting them from the queue.