Search in sources :

Example 6 with SeldonAPIException

use of io.seldon.apife.exception.SeldonAPIException in project seldon-core by SeldonIO.

the class SeldonService method sendFeedback.

@Override
public void sendFeedback(io.seldon.protos.PredictionProtos.Feedback request, io.grpc.stub.StreamObserver<io.seldon.protos.PredictionProtos.SeldonMessage> responseObserver) {
    try {
        ManagedChannel channel = server.getChannel();
        final SeldonGrpc.SeldonBlockingStub blockingStub = SeldonGrpc.newBlockingStub(channel);
        responseObserver.onNext(blockingStub.sendFeedback(request));
    } catch (SeldonAPIException e) {
        responseObserver.onError(e);
    }
    responseObserver.onCompleted();
}
Also used : SeldonGrpc(io.seldon.protos.SeldonGrpc) SeldonAPIException(io.seldon.apife.exception.SeldonAPIException) ManagedChannel(io.grpc.ManagedChannel)

Aggregations

SeldonAPIException (io.seldon.apife.exception.SeldonAPIException)6 ManagedChannel (io.grpc.ManagedChannel)3 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)2 SeldonGrpc (io.seldon.protos.SeldonGrpc)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 Tag (io.micrometer.core.instrument.Tag)1 DeploymentSpec (io.seldon.protos.DeploymentProtos.DeploymentSpec)1 Feedback (io.seldon.protos.PredictionProtos.Feedback)1 SeldonMessage (io.seldon.protos.PredictionProtos.SeldonMessage)1 IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)1 HttpPost (org.apache.http.client.methods.HttpPost)1 URIBuilder (org.apache.http.client.utils.URIBuilder)1 StringEntity (org.apache.http.entity.StringEntity)1 HttpContext (org.apache.http.protocol.HttpContext)1 HttpHeaders (org.springframework.http.HttpHeaders)1 HttpStatus (org.springframework.http.HttpStatus)1 ResponseEntity (org.springframework.http.ResponseEntity)1