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;
}
Aggregations