0

I'm fairly new to microservices and grpc itself so excuse any ignorance. I have a CSV file and I'm trying to iterate through the file line by line in one microservice and then stream each line to another microservice. The second microservice would then do some sort of calculation before being pushed onto a webserver. Does anyone know how you'd go about this?

Fiach ONeill
  • 155
  • 13
  • Right now this is too vague to answer. Please post your gRPC service definition and your corresponding Python code. – Thomas Mar 25 '21 at 17:25

1 Answers1

0

You should use bidi-stream for this;

  • client
for (line: file.readline()) {
    requestObserver.onNext(line);
}
requestObserver.onCompleted();
  • server
StreamObserver<String>{
   onNext(HelloMessage helloMessage) {
     // handle content here
   }
}
HelloWood
  • 727
  • 4
  • 13