I have a Java based server application using maven for dependency management and a tomcat server to host it. I have a bunch of IoT devices sending different kinds of payloads all the time. Please note the payloads vary in sizes from 1 MB to 80 MB. So, I want to track the usage of data by each device.
Instead of writing payload size checks at every single API, can I write a filter or interceptor to examine payloads for all API requests? Also, if the payload is higher than 80 MB I want to reject the payload.
Please let me know if there's anyway to accomplish this.