How to Use WebSockets with Java | Spring Boot

preview_player
Показать описание
In this video we cover how to create a simple chat application using WebSockets, Java and Spring Boot. The frontend of the app was created with vanilla javascript with SockJS and Stomp and is available to download below.


Рекомендации по теме
Комментарии
Автор

Man, your video(and code), helped me a lot to understanding spring's boot websockets working structure, i was already familiarized with native java websockets, and now i'm migrating my app to this model, thanks a lot

weblucio
Автор

This is a gem of a tutorial. I will be checking out more of your stuff. 9k views is criminal on this.

dayv
Автор

Already been a big help as I downloaded the static content as I was having problems with the JS libraries for STOMP and sockJS. Following some other guides and they were using other libraries which had deprecated functions/methods and nothing was working. The two in your code work for me so thanks!

Sausty
Автор

It's a fantastic video, it helps me a lot with my colledge proyect. There is only one thing that i wuld like to implement is to meke that the chat could show message recive when the user is disconected. But what shoul i ask for a 25 minutes video, simple, clear, and usefull.
GREAT JOB, with people like you I regain faith in humanity during my exams period ❤❤❤❤.

Greetings from Spain.

tellez
Автор

Great tutorial! I'm pretty new to Java, SpringBoot and coding in general. So I really appreciate you breaking things down and explaining what the different parts of code does.

ballads
Автор

great video thank you for this, much love man

dailydose
Автор

well, im shocked this video has only about 900 views, man.
Im sharing the hello outta this vid man
great tut and very informative

xenon
Автор

Very helpful tutorial.
Some notes if I may:
- systematically zoom the file you're editing. It helps viewer appreciate your live coding instead of guessing what you're typing
- if you use Lombok you can take advantage of the @Slf4j annotation, which will work out of the box with any recent spring-boot, instead of bothering with loggers
- a nice, but not so easy, addition would have been to integrate spring-security, add a login page and restrict the chat endpoint to connected users only. If your code was public it would be a contribution I would have loved to add.

You're great in presentations really, you should continue the tutorials!

blushing_wolf
Автор

Hey, nice video. Is there any ways of replacing instead of normal messages to like something different, for example posts with title, body etc, like in facebook? By that creating like a feed in social network.

cumbainer
Автор

thank u for this great tutorial. Can u plz make a video about push notification system using websockets?

saidalyassi
Автор

Hi brother, thanks for your video, now I understand a lot about how web sockets work, but I have a problem when I try to test the socket with postman. I want to learn more and test but.... I don't know how to test it. I hope you can answer my question soon.

daga
Автор

Quick question Shane, instead of using chat messages, could other information be sent?

hxlo
Автор

link for static files doesn't work, can you share the working one?

andreaparlongo
Автор

Hi :) I've followed the tutorial video, but I have an error when I run it. "Could not find the connection you were looking for. Move along. Or, Refresh the page!"
This is the error after I introduce the username and clicked the button for next step. Do you have any idea what's the problem? thanks :)

elaalexandra
Автор

Hi Shane!

i got the same problem that when I start my application it doesnt open up the HTML page in my browser. I get a whitelabel error when i type it in manually, cause there is no mapping for localhost:8090, i didnt missed the part where you set the port on 8090 so that is not the problem.

Thx in advance

terminandor
Автор

Can I publish my modified version of yours for a school project (non-commercial use)?

simonvh
Автор

My front end can't connect to the websocket, something goes wrong with this line self.xhr.send(payload);

luka
Автор

Hi I think something is missing in the tutorial, When you typed localhost:8090 you get your webpage directly, but it is not working for me. I have the html css js files but I think I need to put them somewhere? This is part is not explained, thanks

noxxmoxx
Автор

Hi everyone I'm beginner here
May I have a question?
This chat app need internet access to send or receive the text or not?
#Sincerely grateful for ur answer

seyhaseng
Автор

Hi! I don't know why but if I write a message in the chat and press the send button, the message doesn't appear in the chat.

If a person enters or leaves, the alert messages appear and everything else looks to work ok.

I don't know what to verify? The back-end code seems to look ok, I think is something on javascript or from the front-end and I don't have any experience if you could help me.

Thanks for your video!

silviu-gabrielpopa