Skip to content
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

4.x: protocol-configs does not allow h2 (http/2) #7802

Closed
klustria opened this issue Oct 16, 2023 · 0 comments
Closed

4.x: protocol-configs does not allow h2 (http/2) #7802

klustria opened this issue Oct 16, 2023 · 0 comments
Assignees
Labels
4.x Version 4.x webclient
Milestone

Comments

@klustria
Copy link
Member

klustria commented Oct 16, 2023

Environment Details

  • Helidon Version: 4.x
  • Helidon SE or Helidon MP
  • JDK version:
  • OS:
  • Docker version (if applicable):

Problem Description

Even though http/2 is added as a dependency in the application, adding h2 in protocol-configs fails. h2 is used because it is the config-key for http/2. On the other hand, using http_1_1 to set http/1.1 config works fine.

Steps to reproduce

  1. application.yaml setting:
    client:
        protocol-configs:
            http_1_1:
                max-header-size: 20000
                validate-request-headers: true
            h2:
                prior-knowledge: true
    
  2. Add this in pom.xml of the project's application:
        <dependency>
            <groupId>io.helidon.webclient</groupId>
            <artifactId>helidon-webclient-http2</artifactId>
        </dependency>
    
  3. And client code:
            WebClient client = WebClient.builder()
                    .baseUri(url)
                    .config(config.get("client"))
                    .build();
    

fails with:

Exception in thread "main" io.helidon.common.config.ConfigException: Unknown provider configured. Expected providers with types: [h2], but only the following providers are supported: [http_1_1], provider interface: io.helidon.webclient.spi.ProtocolConfigProvider, configured service: io.helidon.webclient.spi.ProtocolConfig

Observation

There is no Http2ProtocolConfigProvider in webclient that's why h2 does not show up as another option. Http1ProtocolConfigProvider on the other hand exists for http1 webclient

Potential Fix

  1. Add Http2ProtocolConfigProvider.java in http2 module. Use Http1ProtocolConfigProvider.java as the template for this file and just replace all http1 related code with http2.
  2. Add Http2ProtocolConfigProvider in module-info.java of http2 so this will be service loaded:
    ...
    import io.helidon.webclient.http2.Http2ProtocolConfigProvider;
    ...
    ...
         provides io.helidon.webclient.spi.ProtocolConfigProvider
               with Http2ProtocolConfigProvider;
    
@klustria klustria added webclient 4.x Version 4.x labels Oct 16, 2023
@tomas-langer tomas-langer self-assigned this Oct 16, 2023
tomas-langer added a commit to tomas-langer/helidon that referenced this issue Oct 16, 2023
@tomas-langer tomas-langer added this to the 4.0.0 milestone Oct 16, 2023
tomas-langer added a commit that referenced this issue Oct 16, 2023
* Fix for #7801 - webclient proxy cannot be set using configuration.
* Fix for #7802 - webclient protocol configuration for HTTP/2 did not work.
dalexandrov pushed a commit to dalexandrov/helidon that referenced this issue Oct 17, 2023
* Fix for helidon-io#7801 - webclient proxy cannot be set using configuration.
* Fix for helidon-io#7802 - webclient protocol configuration for HTTP/2 did not work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x webclient
Projects
Archived in project
Development

No branches or pull requests

2 participants