Class EventProcessor

java.lang.Object
org.chenile.core.event.EventProcessor

public class EventProcessor extends Object
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 Details

  • Constructor Details

    • EventProcessor

      public EventProcessor()
  • Method Details

    • handleEvent

      public void handleEvent(String eventId, Object eventPayload)
    • handleEventAsync

      public void handleEventAsync(String eventId, Object eventPayload)
    • handleEvent

      public void handleEvent(ChenileEventDefinition ced, ChenileExchange chenileExchange)
    • setHeaders

      protected void setHeaders(ChenileExchange chenileExchange)
      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 -