Skip to content

Scheduled Events

akifkhan01 edited this page Nov 7, 2017 · 4 revisions

Flux can accept events with a "trigger Time" epoch timestamp, and process an event at that particular scheduled time. With an introduction of scheduled event feature, a flux user can mention the time delay to trigger a particular event. To submit scheduled event, user need to call following APIs:

new FluxRuntimeConnectorHttpImpl(connectionTimeout, socketTimeout, fluxEndpoint);
void submitScheduledEvent(String name, Object data, String correlationId, String eventSource, Long 
                              scheduledTime);

To make use of scheduled event feature, user need to post an arbitrary event against a previously registered Correlation Id with future time, and the event would be triggered at that particular time.

To achieve scheduled events feature, flux internally uses following methods:

void registerEvent(String correlationId, String eventName, byte[] eventData, Long scheduledTime);
void deregisterEvent(String correlationId, String eventName);
void triggerEvent(String eventName, Object eventData, String correlationId, String eventSource);

Above mentioned methods are used to register/deregister and trigger scheduled events which runs as a part of EventSchedulerService.

Clone this wiki locally