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

Support Spring MVC functional controller #273

Closed
haupv1m opened this issue Apr 13, 2021 · 2 comments
Closed

Support Spring MVC functional controller #273

haupv1m opened this issue Apr 13, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@haupv1m
Copy link

haupv1m commented Apr 13, 2021

Feature Description

From Spring 5.2, functional endpoint approach is already available on Spring MVC. However, currently, newrelic-java agent only support Spring MVC annotation controller

https://docs.spring.io/spring-framework/reference/web/webmvc-functional.html

Describe Alternatives

Support Spring MVC HandlerFunction as Web request handler

(Migrate to Jira)

@jasonjkeller jasonjkeller added the enhancement New feature or request label Apr 19, 2021
@workato-integration
Copy link

@workato-integration workato-integration bot changed the title Support Spring MVC functional controller Support Spring MVC functional controller Sep 30, 2022
@kford-newrelic kford-newrelic added the estimate Issue needing estimation label Jul 19, 2023
@kford-newrelic kford-newrelic removed the estimate Issue needing estimation label Sep 20, 2023
@kford-newrelic kford-newrelic added estimate Issue needing estimation jan-mar qtr Represents proposed work item for the Jan-Mar quarter labels Dec 3, 2023
@kford-newrelic kford-newrelic removed estimate Issue needing estimation jan-mar qtr Represents proposed work item for the Jan-Mar quarter labels Dec 12, 2023
@jtduffy jtduffy closed this as completed Dec 13, 2023
@jtduffy jtduffy reopened this Dec 13, 2023
@jtduffy
Copy link
Contributor

jtduffy commented Dec 13, 2023

The existing instrumentation supports this pattern of controllers with RouterFunctions and registered handlers: For example:

public class Greeting2Router {
    @Bean
    public RouterFunction<ServerResponse> routeGet(Greeting2Handler greetingHandler) {
        return RouterFunctions
                .route(GET("/greet2").and(accept(MediaType.APPLICATION_JSON)), greetingHandler::hello);
    }
}


public class Greeting2Handler {
    public Mono<ServerResponse> hello(ServerRequest request) {
        return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON)
                .body(BodyInserters.fromValue(new Greeting("hello", "world")));
    }
}

@jtduffy jtduffy closed this as completed Dec 13, 2023
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

No branches or pull requests

4 participants