Skip to content

Streaming data of a file in topic with WebSocketMessageBroker #77

@guibernardi

Description

@guibernardi

Hi Rossen. Sorry for bothering you here.

I'm trying to send a file through a topic using websockets.

Actually I was converting the file to base64 and send as a dataUri to the topic like this:

messagingTemplate.convertAndSendToUser(purchaseReport.getSessionId(),
						"/queue/greetings",
						DATA_APPLICATION_ZIP_BASE_64.concat(getDocumentsAsBase64(fileWriter.write(report).toPath())),
						createHeaders(purchaseReport.getSessionId()));

The problem is that when the file is too large the base64 obviously is extremely. So I'm trying to Streaming the file in the topic using SimpMessageSendingOperations, but until now still didn't work.

Do you have any tip or material that I could follow?
I was trying to coding as the same concept of Streaming data using RestTemplate or a regular http request.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions