I have Spring-Boot 2.x application, and some rest controller endpoint that uploads multipart file, like this
@PostMapping("/somePath")
public ResponseEntity someController(@RequestParam MultipartFile file) )
also we have jwtFilter in security filter chain, that checks jwt token for validity;
and we have a situation when token is not valid, but tomcat consumes traffic
how can I check this?:
I use spring boot actuator and make request:
GET http://localhost:8080/actuator/metrics/tomcat.global.received
It possible abort traffic until filter checked token?
Is there a way to avoid redundant traffic?
I tried HttpServletRequest and InputStream as controller param, but result is the same.
Given how expensive the file uploads are and not having any better solution, I would in the meantime:
The other option would be for the client to renew the token before expensive uploads. The client could look at the size of the uploads to make a determination whether to renew or not.