SYS.WAIT_FOR_SENDER_QUEUE_FLUSH

This procedure waits for the queue associated with a gateway sender or AsyncEventListener to empty all events on all members that host the queue or listener (both primaries and secondaries). You can use this procedure interactively or in SQL command scripts before stopping a gateway sender or AsyncEventListener, to ensure that no queued events are lost. GemFire XD automatically calls this procedure before performing an ALTER TABLE statement on a table that is configured with event queues.

Syntax

SYS.WAIT_FOR_SENDER_QUEUE_FLUSH(
    IN ID VARCHAR(256),
    IN IS_ASYNCLISTENER BOOLEAN,
    IN MAX_WAIT_TIME INTEGER
) 
ID
The unique name of the gateway sender or AsyncEventListener. This corresponds to the ID column value in ASYNCEVENTLISTENERS or the SENDER_ID column value in GATEWAYSENDERS. This attribute cannot be null.
IS_ASYNCLISTENER
Specify "true" if the ID is an AsyncEventListener, or "false" if the ID is a gateway sender.
MAX_WAIT_TIME
The maximum amount of time, in seconds, to wait for the queue to flush. Specify zero (0) to block indefinitely until the queue is empty.

Example

This command blocks until GemFire XD flushes the queue associated with cluster-1-sender:
gfxd> call sys.wait_for_sender_queue_flush ('CLUSTER-1-SENDER', 'false', 0);