I am trying to find handle the akka Payloadsizeexceeded exception. But since there is no way to handle it, I would like to know the size of the message that is being passed. For this I would like to calculate the size of message and this size needs to give the exact size of the clustermessage being passed not just the json size inside my request. Is there a way to know this size?
For example my json size is 31998bytes but when the message is being passed between the actors some amount of encoding is happening and the actual size of the message being passed is increased to 32778. How can I know this final message size?