Skip to content

Add experimental support for Spring Boot 4 and Spring Framework 7 in WebFlux#4489

Open
sergiofdezfernandez wants to merge 1 commit into
elastic:mainfrom
sergiofdezfernandez:feature/spring-webflux-7-support
Open

Add experimental support for Spring Boot 4 and Spring Framework 7 in WebFlux#4489
sergiofdezfernandez wants to merge 1 commit into
elastic:mainfrom
sergiofdezfernandez:feature/spring-webflux-7-support

Conversation

@sergiofdezfernandez
Copy link
Copy Markdown

@sergiofdezfernandez sergiofdezfernandez commented May 27, 2026

What does this PR do?

This PR adds experimental support for Spring Boot 4 / Spring Framework 7 in the WebFlux instrumentation plugin by replacing all usages of the removed HttpHeaders.get(Object) API with HttpHeaders.getValuesAsList(String), which exists with the same signature across Spring Framework 5.x, 6.x, and 7.x.

Closes: Issue 4472

Background

In Spring Framework 6+, org.springframework.http.HttpHeaders no longer extends MultiValueMap<String, String> (and therefore no longer implements Map). The inherited Map.get(Object) method was removed in Spring 7. Our advice classes were compiled against Spring 5, so at runtime on Spring Boot 4 they threw:
java.lang.NoSuchMethodError: 'java.util.List org.springframework.http.HttpHeaders.get(java.lang.Object)'

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.next-release.md
    • I have added tests that prove my fix is effective or that my feature works
    • Added an API method or config option? Document in which version this will be introduced
    • I have made corresponding changes to the documentation
  • This is a bugfix
  • This is a new plugin
    • I have updated CHANGELOG.next-release.md
    • My code follows the style guidelines of this project
    • I have made corresponding changes to the documentation
    • I have added tests that prove my fix is effective or that my feature works
    • New and existing unit tests pass locally with my changes
    • I have updated supported-technologies.md
    • Added an API method or config option? Document in which version this will be introduced
    • Added an instrumentation plugin? Describe how you made sure that old, non-supported versions are not instrumented by accident.
  • This is something else

@sergiofdezfernandez sergiofdezfernandez requested a review from a team as a code owner May 27, 2026 17:15
@cla-checker-service
Copy link
Copy Markdown

cla-checker-service Bot commented May 27, 2026

💚 CLA has been signed

@github-actions
Copy link
Copy Markdown

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions Bot added agent-java community Issues and PRs created by the community triage labels May 27, 2026
@sergiofdezfernandez sergiofdezfernandez force-pushed the feature/spring-webflux-7-support branch from 11d559d to 5adbf2c Compare May 27, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-java community Issues and PRs created by the community triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spring WebFlux 7 (Spring Boot 4): NoSuchMethodError in DispatcherHandlerInstrumentation

1 participant