public void handleError(Object event, Exception e) {
        if (exceptionListener != null) {
            exceptionListener.exceptionThrown(e);
        }
        switch (onErrorAction) {
            case LOG:
                log.error("Error in '" + siddhiAppContext.getName() + "' after consuming events "
                        + "from Stream '" + streamDefinition.getId() + "', " + e.getMessage()
                        + ". Hence, dropping event '" + event.toString() + "'", e);
                break;
            case STREAM:
                if (faultStreamJunction != null) {
                    StreamEvent streamEvent = null;
                    if (event instanceof ComplexEvent) {
                        streamEvent = faultStreamEventConverter.convert((ComplexEvent) event, e);
                        faultStreamJunction.sendEvent(streamEvent);
                    } else if (event instanceof Event) {
                        streamEvent = faultStreamEventConverter.convert((Event) event, e);
                        faultStreamJunction.sendEvent(streamEvent);
                    } else if (event instanceof Event[]) {
                        streamEvent = faultStreamEventConverter.convert((Event[]) event, e);
                        faultStreamJunction.sendEvent(streamEvent);
                    } else if (event instanceof List) {
                        streamEvent = faultStreamEventConverter.convert((List<Event>) event, e);
                        faultStreamJunction.sendEvent(streamEvent);
                    }
                } else {
                    log.error("Error in SiddhiApp '" + siddhiAppContext.getName() +
                            "' after consuming events from Stream '" + streamDefinition.getId()
                            + "', " + e.getMessage() + ". Siddhi Fault Stream for '" + streamDefinition.getId()
                            + "' is not defined. " + "Hence, dropping event '" + event.toString() + "'", e);
                }
                break;
            case STORE:
                ErroneousEvent erroneousEvent =
                        new ErroneousEvent(event, e, "Error in SiddhiApp '" + siddhiAppContext.getName() +
                                "' after consuming events from Stream '" + streamDefinition.getId()
                                + "', " + e.getMessage() + ". Siddhi Fault Stream for '" + streamDefinition.getId()
                                + "' is not defined. " + "Hence, dropping event '" + event.toString() + "'");
                ErrorStoreHelper.storeErroneousEvent(siddhiAppContext.getSiddhiContext().getErrorStore(),
                        ErrorOccurrence.STORE_ON_STREAM_ERROR, siddhiAppContext.getName(), erroneousEvent,
                        streamDefinition.getId());
                break;
            default:
                break;
        }
    }
Create and start disruptor based on annotations given in the streamDefinition.
modules/siddhi-core/src/main/java/io/siddhi/core/stream/StreamJunction.java