fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

Feature request: Output stream response online #329

Closed murfel closed 1 year ago

murfel commented 1 year ago

I have a GRPC service with a method that returns a stream of messages. In particular, this is an infinite stream (use case: messenger). When I call this method with grpcurl, it doesn't show any output, as it never reaches the end of stream. Is it possible to output messages online, once they are received, without waiting for the end of stream? Thank you!

dragonsinth commented 1 year ago

Oh that's interesting.... that seems totally reasonable.

dragonsinth commented 1 year ago

Hi @murfel I was able to get this to work out of the box using the chatterbox example server, found here: https://github.com/fullstorydev/go/tree/master/examples/chatterbox

~/github/go/src/github.com/fullstorydev/go/examples/chatterbox grpcurl -import-path . -proto chatterbox.proto -plaintext -d '{}' 127.0.0.1:9000 chatterbox.ChatterBox/Monitor
{

}
{
  "who": "User 1",
  "what": "JOIN"
}
{
  "who": "User 1",
  "what": "CHAT",
  "text": "hi"
}
murfel commented 1 year ago

Hi @dragonsinth! Oh, thank you. I checked it myself and it does work. It was an error in my code. I must have been very tired debugging other stuff back then. Sorry for disruption!

dragonsinth commented 1 year ago

No worries, thanks for getting back and confirming! :)