Package org.chenile.core.event
Class EventProcessor
java.lang.Object
org.chenile.core.event.EventProcessor
A sequential way of processing an event within the same thread. Sends the event payload to
each of the event subscribers in a loop. This can be used if a simple SEDA pipeline needs
to be established in the same thread within a single transaction. An example of this is
logging threads which need to do a bunch of things before a user is considered to be logged in.
This should not be used if parallelism is desired.
This is a very handy way of doing testing. It is also internally used by all Chenile subscribers at the entry point. Chenile file watcher, scheduler etc. use this class internally.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ChenileEntryPoint
(package private) ChenileConfiguration
(package private) org.slf4j.Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(String eventId, Object eventPayload) void
void
handleEvent
(ChenileEventDefinition ced, ChenileExchange chenileExchange) void
handleEventAsync
(String eventId, Object eventPayload) protected void
setHeaders
(ChenileExchange chenileExchange) An Extension point to allow subclasses to set the headers in the Chenile Exchange prior to invoking it.
-
Field Details
-
logger
org.slf4j.Logger logger -
chenileServiceConfiguration
@Autowired @Qualifier("chenileServiceConfiguration") ChenileConfiguration chenileServiceConfiguration -
chenileEntryPoint
-
-
Constructor Details
-
EventProcessor
public EventProcessor()
-
-
Method Details
-
handleEvent
-
handleEvent
-
handleEventAsync
-
handleEvent
-
setHeaders
An Extension point to allow subclasses to set the headers in the Chenile Exchange prior to invoking it. These headers would be app specific and hence this class needs to be subclassed by the actual application for the purpose of setting headers.- Parameters:
chenileExchange
-
-