Skip to content

Make http header list size configurable in HTTP client for HTTP2#12172

Merged
yawkat merged 1 commit intomicronaut-projects:4.10.xfrom
Pavlov7:max_header_list_size_client_http2
Nov 26, 2025
Merged

Make http header list size configurable in HTTP client for HTTP2#12172
yawkat merged 1 commit intomicronaut-projects:4.10.xfrom
Pavlov7:max_header_list_size_client_http2

Conversation

@Pavlov7
Copy link
Contributor

@Pavlov7 Pavlov7 commented Nov 6, 2025

Description

This PR adds configurable maxHeaderListSize property to HTTP client configuration for HTTP2.

Added maxHeaderListSize configuration property with getter/setter methods.
Updated Http2FrameCodec instantiation to use the configurable header list size.

Considerations

Can be configured via micronaut.http.client.http2.max-header-list-size property.

Description

This PR adds configurable maxHeaderListSize property to HTTP client configuration for HTTP2.

    Added maxHeaderListSize configuration property with getter/setter methods.
    Updated Http2FrameCodec instantiation to use the configurable header list size.

Considerations

    Can be configured via micronaut.http.client.http2.max-header-list-size property.
@sdelamo sdelamo requested a review from yawkat November 11, 2025 11:46
@sdelamo sdelamo moved this to In Progress in 4.10.2 Release Nov 11, 2025
@yawkat
Copy link
Member

yawkat commented Nov 11, 2025

Please take a look at Http2Settings and implement it similar to that config.

@Pavlov7
Copy link
Contributor Author

Pavlov7 commented Nov 15, 2025

Please take a look at Http2Settings and implement it similar to that config.

The main difference I see between Http2ClientConfiguration and Http2Settings is that Http2Settings is holding an instance of io.netty.handler.codec.http2.Http2Settings and getters and setters are reading from/writing to that instance.
I am not sure whether it would be better for Http2ClientConfiguration to also start holding an instance of io.netty.handler.codec.http2.Http2Settings, because then the micronaut-http-client-core module has to start depending on micronaut-http-netty so that it transitively starts depending on io.netty.codec.http2

@Pavlov7
Copy link
Contributor Author

Pavlov7 commented Nov 24, 2025

Please take a look at Http2Settings and implement it similar to that config.

The main difference I see between Http2ClientConfiguration and Http2Settings is that Http2Settings is holding an instance of io.netty.handler.codec.http2.Http2Settings and getters and setters are reading from/writing to that instance. I am not sure whether it would be better for Http2ClientConfiguration to also start holding an instance of io.netty.handler.codec.http2.Http2Settings, because then the micronaut-http-client-core module has to start depending on micronaut-http-netty so that it transitively starts depending on io.netty.codec.http2

^ @yawkat

@graemerocher graemerocher moved this to In Progress in 4.10.3 Release Nov 25, 2025
@graemerocher
Copy link
Contributor

@yawkat please review the feedback

@yawkat
Copy link
Member

yawkat commented Nov 26, 2025

Yea you're right. My idea doesn't work.

@yawkat yawkat merged commit ed259d2 into micronaut-projects:4.10.x Nov 26, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in 4.10.3 Release Nov 26, 2025
@jdeex
Copy link
Contributor

jdeex commented Feb 12, 2026

@Pavlov7 I think this one broke the consul client. It doesn't get any HTT2Configuration and tries to override the defaults causing a nullpointer. I set the 3 configuration options for max-header-list-size but HTT2Configuration is always null. Also did a quick fix to avoid the nullpointer on #12389, but not sure if that's the way you would like to go... We cannot upgrade to latest versions because of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants