Skip to content

Are there any plans to support http/2.0 #809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thousmile opened this issue Dec 20, 2022 · 10 comments
Closed

Are there any plans to support http/2.0 #809

thousmile opened this issue Dec 20, 2022 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@thousmile
Copy link

http server enable http2.0 .
But feign client still uses http/1.1 protocol

@galaxy-sea
Copy link
Contributor

hello @OlgaMaciaszek , can you assign this issue to me.

@OlgaMaciaszek
Copy link
Collaborator

Sure @galaxy-sea :) .

@OlgaMaciaszek
Copy link
Collaborator

HTTP2 is supported by OkHttp and it's enabled by default. There's also support in Apache HC5. We should add the support for this within this issue.

@galaxy-sea
Copy link
Contributor

galaxy-sea commented Feb 2, 2023

hello @OlgaMaciaszek , feign.hc5.ApacheHttp5Client does not support the http2, but feign.hc5.AsyncApacheHttp5Client supports http2

@galaxy-sea
Copy link
Contributor

I've sorted out the clients that support the http2 protocol. AsyncClients is the best for supporting the http2 protocol.

client http/2.0
feign.Client.Default no
feign.hc5.ApacheHttp5Client no
feign.okhttp.OkHttpClient yes
feign.http2client.Http2Client yes
AsyncClient http/2.0
feign.AsyncClient.Default yes
feign.hc5.AsyncApacheHttp5Client yes
ffeign.okhttp.OkHttpClient yes
feign.http2client.Http2Client yes

@galaxy-sea
Copy link
Contributor

Maybe we need to implement the http2 protocol on the basis of Async feign flow #511.

@WangJincheng4869
Copy link

WangJincheng4869 commented Apr 11, 2025

Has this issue not been resolved yet? No matter which configuration is used, HTTP/2 will not be utilized. My server-side configuration should be fine because testing with curl works without any issues, but it doesn't work with OpenFeign.

@WangJincheng4869
Copy link

WangJincheng4869 commented Apr 12, 2025

@thousmile
大佬,你是怎么解决的啊。我这一直有问题,我是这么配置的。用 curl 测试了,我的服务端没问题,能用 HTTP/2,就是用 openfeign 不行。这个问题已经困扰我好多天了,我也引用了 okhttp 的依赖。但就是不行,一开始我用 httpclient5 的方式也不行。

发现你是中国人,我就不翻译成英文了,意思会被曲解。

spring:
  cloud:
    openfeign:
      client:
        refresh-enabled: true
      okhttp:
        enabled: true
      httpclient:
        ok-http:
          protocols:
            - H2_PRIOR_KNOWLEDGE

@galaxy-sea
Copy link
Contributor

@WangJincheng4869
Copy link

@galaxy-sea 非常感谢,原来我是被日志骗了

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants