1

I have 2 services written in c++ which have to run in separate PoDs with envoy proxy side car in each pod. Envoy proxies the requests to the service over HTTP2. I need to implement bidirectional streaming here. I came across nghttp2 and nghttp2 asio libraries implemented in c/c++. But I am not sure which one supports bidirectional streaming or will it be better to use an rpc like grpc which inherently provides infrastructure for bidirectional streaming

Neeraj Jain
  • 31
  • 1
  • 6
  • The `nghttp2 asio` is the high level C++ API (based on `Boost asio` library) to implement HTTP/2 server and client application, while the `nghttp2` is low level C library which can be used for the same purpose. However, I believe `grpc` will be more suitable for you. https://grpc.io/docs/tutorials/basic/cpp/ – Soumya Kanti Oct 15 '19 at 05:11
  • Thanks Soumya. Are you aware if nghttp2 asio implements the complete state machine including flow control and stream prioritization for bidirectional stream case? – Neeraj Jain Oct 15 '19 at 08:50
  • It has flow control, not sure about stream prioritization - but no state machine. If you want to implement the state machine, then you will essentially reinvent the wheel, aka, grpc. Grpc is based on HTTP/2. – Soumya Kanti Oct 15 '19 at 12:02
  • gRPC is a good fit for this use case. See https://grpc.io/docs/guides/concepts/. gRPC supports flow control. Stream prioritization is not supported, and AFAIK there are no plans to implement it. – user3126412 Oct 16 '19 at 17:36

0 Answers0