In my project I can't get a direct return statement.
Via JSON generator I can see some methods that set output to JSON string.
I used debug mode to find out the flow:
Methods are
writeOutputParameterStart(stored proc. Result)
writeOutputParameterEnds(stored proc. Result)
I need to find the JSON string.
Is the JSON string created internally by Jackson library? Is there any means I can get the size of that response in JSON?
So basically every jsonGenerator object has underlying output stream or writer. So we can invoke getOutputBuffered() method on jsonGenerator object which will return the size of buffered response in int.
So my response size here is 1900 bytes (1.9KB ) which I can directly see in postman page & now I can also print this on log so that a tool SPLUNK can retrieve from server log of my application
NOTE- we should call this method before jsonGenerator is flushed. So once any stream is flushed we can't get buffered data size.
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.