I am having an issue where the request is delayed by 1 minute.
I have enabled TRACE logs on springframework which indicated there is a delay between FilterChainProxy
and DispatcherServlet
.
So far I am not able to make any progress as this issue is consistent.
Application Logs
2022-08-31 16:12:31.256 TRACE 42851 --- [nio-9090-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Authorizing filter invocation [POST /com/myrequest/my-action.do] with attributes [authenticated]
2022-08-31 16:12:31.256 DEBUG 42851 --- [nio-9090-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Authorized filter invocation [POST /com/myrequest/my-action.do] with attributes [authenticated]
2022-08-31 16:12:31.256 TRACE 42851 --- [nio-9090-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Did not switch RunAs authentication since RunAsManager returned null
2022-08-31 16:12:31.256 DEBUG 42851 --- [nio-9090-exec-7] o.s.security.web.FilterChainProxy : Secured POST /com/myrequest/my-action.do
2022-08-31 16:13:31.259 TRACE 42851 --- [nio-9090-exec-7] o.s.web.servlet.DispatcherServlet : POST "/com/myrequest/my-action.do", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
2022-08-31 16:13:31.259 TRACE 42851 --- [nio-9090-exec-7] o.s.b.f.s.DefaultListableBeanFactory : Returning cached instance of singleton bean 'dashboardController'
Spring boot application.yml
file
logging:
level:
org.springframework: TRACE
com.myorg: TRACE
This is maven based project and I am using spring-boot-starter-parent:2.5.12
.
Finally with the help of colleague we discovered that content type was not correct.
While invoking request from jQuery Ajax we are not passing any content type on POST request which defaults to application/x-www-form-urlencoded; charset=UTF-8
application/x-www-form-urlencoded; charset=UTF-8
and on the controller side we didn't have any consumes
. After passing correct contentType on both side we were able to fix the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.