Reputation: 93
I am making a chat application backend using spring WebSockets. The protocol for communication is STOMP and I am using rabbitmq as a message broker.
I want to test my application using postman but I can't find any helpful tutorial/video.
Upvotes: 4
Views: 7324
Reputation: 654
Socket URL: ws://localhost:8080/gs-guide-websocket
Destination/Publish: /app/hello
In my case I should send name from client to server String name
Make sure you append the end with ASCII NULL character [edit -> Character Panel]
About STOMP Frames -> https://stomp.github.io/stomp-specification-1.2.html#STOMP_Frames
SEND
destination:/app/hello
{"name":"test"}
Connect to socket server -> Paste HEX content from notepad++ to message tab in postman -> Change to Binary type, Hexadecimal subtype-> Click Send
As you can see, the message is broadcasted.
To see how the server is working, check out the example here -> https://spring.io/guides/gs/messaging-stomp-websocket
Upvotes: 5
Reputation: 1149
have a look on this post. I think it's usefull for your request. https://dev.to/danielsc/testing-stomp-websocket-with-postman-218a
Basically you have to encode sokect message to Base64 and send it through postman by using its websocket feature
Upvotes: 0