@Override
    public void handleReply(Reply reply) {
        Object o = reply.getContext();
        if (!(o instanceof ReplyContext)) {
            return;
        }
        ReplyContext context = (ReplyContext) o;
        final double latencyInSeconds = (System.currentTimeMillis() - context.creationTime) / 1000.0d;
        metric.set(MetricNames.LATENCY, latencyInSeconds, null);

        DocumentOperationType type = DocumentOperationType.fromMessage(reply.getMessage());
        boolean conditionMet = conditionMet(reply);
        if (reply.hasErrors() && conditionMet) {
            DocumentOperationStatus status = DocumentOperationStatus.fromMessageBusErrorCodes(reply.getErrorCodes());
            metricsHelper.reportFailure(type, status);
            metric.add(MetricNames.FAILED, 1, null);
            enqueue(context, reply.getError(0).getMessage(), ErrorCode.fromBusError(reply.getError(0)), false, reply.getTrace());
        } else {
            metricsHelper.reportSuccessful(type, latencyInSeconds);
            if ( ! conditionMet)
                metric.add(MetricNames.CONDITION_NOT_MET, 1, testAndSetMetricCtx);
            else if ( ! updateNotFound(reply))
                metric.add(MetricNames.NOT_FOUND, 1, null);
            else
                metric.add(MetricNames.SUCCEEDED, 1, null);

            enqueue(context, "Document processed.", ErrorCode.OK, !conditionMet, reply.getTrace());
        }
    }
Catch message bus replies and make the available to a given session.

@author Steinar Knutsen
vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReplyReader.java