Suppose we have 10mb of data in a table, with select query I am storing all those data in resultset object. Now I have to iterate over the resultset and convert it to specific json format.
I have to store only 1mb of data in that json message so that i can publish 1mb json message into kafka topic. SO how to check the size of json message in bytes?
jsonObject.toString().getBytes().length; is this correct?