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. For example, if a Kafka event needs to be handled by multiple subscribers we expect the multi-threading to happen by the Kafka client. This class must not be used.
-
Field Summary
Modifier and TypeFieldDescription(package private) ChenileEntryPoint
(package private) ChenileConfiguration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(String eventId, Object eventPayload) 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
-
chenileServiceConfiguration
@Autowired @Qualifier("chenileServiceConfiguration") ChenileConfiguration chenileServiceConfiguration -
chenileEntryPoint
-
-
Constructor Details
-
EventProcessor
public EventProcessor()
-
-
Method Details
-
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
-
-