Search in sources :

Example 1 with ErrorDirective

use of com.yahoo.messagebus.routing.ErrorDirective in project vespa by vespa-engine.

the class DocumentOperationMessageV3 method newErrorMessage.

static DocumentOperationMessageV3 newErrorMessage(String operationId, Exception exception) {
    Message feedErrorMessageV3 = new FeedErrorMessage(operationId);
    DocumentOperationMessageV3 msg = new DocumentOperationMessageV3(operationId, feedErrorMessageV3);
    Hop hop = new Hop();
    hop.addDirective(new ErrorDirective(Exceptions.toMessageString(exception)));
    Route route = new Route();
    route.addHop(hop);
    feedErrorMessageV3.setRoute(route);
    return msg;
}
Also used : UpdateDocumentMessage(com.yahoo.documentapi.messagebus.protocol.UpdateDocumentMessage) Message(com.yahoo.messagebus.Message) RemoveDocumentMessage(com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage) PutDocumentMessage(com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage) Hop(com.yahoo.messagebus.routing.Hop) ErrorDirective(com.yahoo.messagebus.routing.ErrorDirective) Route(com.yahoo.messagebus.routing.Route)

Example 2 with ErrorDirective

use of com.yahoo.messagebus.routing.ErrorDirective in project vespa by vespa-engine.

the class Feeder method newErrorMessage.

private Tuple2<String, Message> newErrorMessage(String operationId, Exception e) {
    Message m = new FeedErrorMessage(operationId);
    Tuple2<String, Message> msg = new Tuple2<>(operationId, m);
    Hop hop = new Hop();
    hop.addDirective(new ErrorDirective(Exceptions.toMessageString(e)));
    Route route = new Route();
    route.addHop(hop);
    m.setRoute(route);
    return msg;
}
Also used : PutDocumentMessage(com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage) UpdateDocumentMessage(com.yahoo.documentapi.messagebus.protocol.UpdateDocumentMessage) Message(com.yahoo.messagebus.Message) DocumentMessage(com.yahoo.documentapi.messagebus.protocol.DocumentMessage) RemoveDocumentMessage(com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage) Tuple2(com.yahoo.collections.Tuple2) Hop(com.yahoo.messagebus.routing.Hop) Utf8String(com.yahoo.text.Utf8String) ErrorDirective(com.yahoo.messagebus.routing.ErrorDirective) Route(com.yahoo.messagebus.routing.Route)

Aggregations

PutDocumentMessage (com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage)2 RemoveDocumentMessage (com.yahoo.documentapi.messagebus.protocol.RemoveDocumentMessage)2 UpdateDocumentMessage (com.yahoo.documentapi.messagebus.protocol.UpdateDocumentMessage)2 Message (com.yahoo.messagebus.Message)2 ErrorDirective (com.yahoo.messagebus.routing.ErrorDirective)2 Hop (com.yahoo.messagebus.routing.Hop)2 Route (com.yahoo.messagebus.routing.Route)2 Tuple2 (com.yahoo.collections.Tuple2)1 DocumentMessage (com.yahoo.documentapi.messagebus.protocol.DocumentMessage)1 Utf8String (com.yahoo.text.Utf8String)1