Search in sources :

Example 1 with EventCanNotBeDeliveredException

use of com.sequenceiq.flow.reactor.eventbus.EventCanNotBeDeliveredException in project cloudbreak by hortonworks.

the class EventBusConfig method getFlowIdFromThrowable.

private String getFlowIdFromThrowable(Throwable throwable) {
    try {
        if (throwable.getCause() instanceof Exceptions.ValueCause) {
            if (((Exceptions.ValueCause) throwable.getCause()).getValue() instanceof Event) {
                Event event = (Event) ((Exceptions.ValueCause) throwable.getCause()).getValue();
                LOGGER.info("Failed event: {}", event);
                return getFlowIdFromEventHeaders(event);
            }
        } else if (throwable instanceof EventCanNotBeDeliveredException) {
            Event event = ((EventCanNotBeDeliveredException) throwable).getEvent();
            return getFlowIdFromEventHeaders(event);
        }
    } catch (Exception e) {
        LOGGER.error("Something wrong happened when we tried to get flowId from headers", e);
    }
    return null;
}
Also used : EventCanNotBeDeliveredException(com.sequenceiq.flow.reactor.eventbus.EventCanNotBeDeliveredException) Exceptions(reactor.core.support.Exceptions) Event(reactor.bus.Event) EventCanNotBeDeliveredException(com.sequenceiq.flow.reactor.eventbus.EventCanNotBeDeliveredException)

Aggregations

EventCanNotBeDeliveredException (com.sequenceiq.flow.reactor.eventbus.EventCanNotBeDeliveredException)1 Event (reactor.bus.Event)1 Exceptions (reactor.core.support.Exceptions)1