I am working on a messaging application using Spring websockets(STOMP as a sub-protocol) and Sockjs.
I should provide support to send files in messages.
According to this ticket, sockjs does not support binary data, but STOMP does.
I know that we can convert image to base64 and send it over stomp, but i think this is not the best practice as there is lot of conversion and overhead. Also I have to save the messages, So to save this base64 encoded files at server again I will have to decode them.
I have couple of questions :
1) Is there a workaround to send image/files over sockjs + stomp or converting to Base64 is the only way?
2) May be this a very silly question but according to this question it is possible to send binary data over STOMP(without sockjs). How difficult is it to support fallback without sockjs?
Thank you.
EDIT : If using base64 is the only option, I would rather make a POST request to save the messages which has attachments instead of using base64 encoding. Any ideas which is better?