How does GRPC work in Cloud Foundry? GoRouter doesn't support HTTP2

浪尽此生 提交于 2021-01-25 07:14:19

问题


I need to use GRPC for inter communication between 2 micro services. But by default, cloud foundry use Go router that doesn't support Http2. And by default, many of cloud foundry installation doesn't expose TCP port itself. Is there any work around or is there any interface that will support this scenario?

I have tried using EUREKA with spring boot. It still uses HTTP1.1.


回答1:


You are correct, Gorouter doesn't support HTTP/2. To make HTTP/2 and/or gRPC work on CF, you have two options.

  1. If you have the need for public clients (i.e.clients outside CF) to connect to your app, you need to use TCP routing. If your provider doesn't enable this by default, find another provider (see this list of public providers, hint Pivotal Web Services will provide TCP routes upon request) or self host.

  2. If you only need to use HTTP/2 and/or gRPC between apps running on CF, you can use the container to container network. When you talk app to app, there are no restrictions (so long as you properly open required ports). You can use TCP, UDP and any protocol built on top of those. There some details about how this works here.

Hope that helps!



来源:https://stackoverflow.com/questions/55438084/how-does-grpc-work-in-cloud-foundry-gorouter-doesnt-support-http2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!