2
votes

Suppose I want to use Grpc Server streaming or Bidirectional streaming.

Is there any limitation on how long stream can last having in mind that it uses http/2 underneath?

If so can it be used to replace message bus, so stream can be opened and live for as long as you want?

1

1 Answers

5
votes

In localized environments (like a data center), streams can last as long as you want. You'd mainly be limited by the client or server restart rate.

However, if going through the Internet, then generally there will be a proxy between the client and server. Proxies need to occasionally shut down the connection in order to maintain balance. So you'd be much more limited here.

I'll note that any time you have long-lived streams, it's a good idea to enable keepalive.