Search in sources :

Example 11 with ErroneousEvent

use of io.siddhi.core.util.error.handler.model.ErroneousEvent in project siddhi by wso2.

the class TestSourceOptionSourceMapper method mapAndProcess.

@Override
protected void mapAndProcess(Object eventObject, InputEventHandler inputEventHandler) throws MappingFailedException, InterruptedException {
    if (eventObject != null) {
        if (eventObject instanceof Event) {
            Event event = ((Event) eventObject);
            event.getData()[0] = sourceOptionHolder.validateAndGetOption("topic").getValue(event);
            event.getData()[1] = sourceType;
            inputEventHandler.sendEvent((Event) eventObject);
        } else {
            throw new MappingFailedException(Collections.singletonList(new ErroneousEvent(eventObject, "Event object must be Event " + "but found " + eventObject.getClass().getCanonicalName())));
        }
    }
}
Also used : ErroneousEvent(io.siddhi.core.util.error.handler.model.ErroneousEvent) Event(io.siddhi.core.event.Event) MappingFailedException(io.siddhi.core.exception.MappingFailedException) ErroneousEvent(io.siddhi.core.util.error.handler.model.ErroneousEvent)

Aggregations

ErroneousEvent (io.siddhi.core.util.error.handler.model.ErroneousEvent)11 Event (io.siddhi.core.event.Event)4 ConnectionUnavailableException (io.siddhi.core.exception.ConnectionUnavailableException)4 MappingFailedException (io.siddhi.core.exception.MappingFailedException)4 ReplayableTableRecord (io.siddhi.core.util.error.handler.model.ReplayableTableRecord)4 DatabaseRuntimeException (io.siddhi.core.exception.DatabaseRuntimeException)3 StreamEvent (io.siddhi.core.event.stream.StreamEvent)2 ComplexEvent (io.siddhi.core.event.ComplexEvent)1 AttributeMapping (io.siddhi.core.stream.input.source.AttributeMapping)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1