use of com.metamx.tranquility.tranquilizer.MessageDroppedException in project storm by apache.
the class DruidBeamBolt method process.
@Override
protected void process(final Tuple tuple) {
Future future = tranquilizer.send((druidEventMapper.getEvent(tuple)));
LOG.debug("Sent tuple : [{}]", tuple);
future.addEventListener(new FutureEventListener() {
@Override
public void onFailure(Throwable cause) {
if (cause instanceof MessageDroppedException) {
collector.ack(tuple);
LOG.debug("Tuple Dropped due to MessageDroppedException : [{}]", tuple);
if (druidConfig.getDiscardStreamId() != null)
collector.emit(druidConfig.getDiscardStreamId(), new Values(tuple, System.currentTimeMillis()));
} else {
collector.fail(tuple);
LOG.debug("Tuple Processing Failed : [{}]", tuple);
}
}
@Override
public void onSuccess(Object value) {
collector.ack(tuple);
LOG.debug("Tuple Processing Success : [{}]", tuple);
}
});
}
Aggregations