use of com.yahoo.messagebus.Error in project vespa by vespa-engine.
the class RoundRobinPolicy method select.
// Inherit doc from RoutingPolicy.
public void select(RoutingContext ctx) {
Hop hop = getRecipient(ctx);
if (hop != null) {
Route route = new Route(ctx.getRoute());
route.setHop(0, hop);
ctx.addChild(route);
} else {
Reply reply = new EmptyReply();
reply.addError(new Error(ErrorCode.NO_ADDRESS_FOR_SERVICE, "None of the configured recipients are currently available."));
ctx.setReply(reply);
}
}
Aggregations