Spring Controller Method annotated with @ResponseBody
takes long time to generate JSON response when I annotate it with @GET
HTTP Method annotation
While the same method when annotated with @POST
(keeping @ResponseBody
annotation intact), the JSON response is generated quickly.
MappingJackson2HttpMessageConverter
is configured in our application along with RequestMappingHandlerAdapter
.
I can say that response generation is taking time since after returning from the controller method, the call back on JavaScript Ajax request takes longer to get called when @GET
is used on method as compared to when @POST
is used on method.
Can someone please help me understand what is taking time.
Or any help in understanding what all spring interceptors/handlers are getting called in response generation, will be greatly appreciated.