Full Stack Real Time Chat: Java Spring Boot, Web Sockets, React JS

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • #FullStack #Chat #Java #Spring #Boot #WebSockets #ReactJS

Комментарии • 15

  • @tmagan0836
    @tmagan0836 Год назад +2

    Nice video! It would be awesome if you also add a link to the github repository. Really good content tho keep it up!

    • @itgift-ht1ro
      @itgift-ht1ro  Год назад +2

      Sure, thank you!
      github.com/Algol22/JavaWebSocketReact

  • @user-sf1sv3xh5w
    @user-sf1sv3xh5w 3 месяца назад

    Hi thank you for your video. It helps a lot.
    I use Gradle instead of Maven for my project.
    I was trying to add this real time chat feature to my project, but I get this error message.
    "EventSource's response has a MIME type ("application/json") that is not "text/event-stream". Aborting the connection."
    And it seems that WebSocket connection fails because of this error.
    I modified my WebConfig and WebsocketConfig accordingly, but I still have the same error.
    Do you have any suggestions or idea what might have triggered this issue?

    • @user-sf1sv3xh5w
      @user-sf1sv3xh5w 3 месяца назад

      I don't exactly know, but I figured it out. my jwt token was the issue so I implemented HandshakeInterceptor and created WebsocketHandshakeInterceptor. Again, thanks for your video as it helped me to gain much insight of overall websocket and how it works. thanks!!

  • @damakavitha7385
    @damakavitha7385 5 месяцев назад

    I got an error

  • @insane00gaming86
    @insane00gaming86 4 месяца назад

    Not working

  • @thatsweirdo6664
    @thatsweirdo6664 9 месяцев назад

    Sir the connection is not established yet error is coming

    • @CristianDiazPerdomo
      @CristianDiazPerdomo 7 месяцев назад

      I had the same error it was due to client variable need time because it's async.
      useEffect(() => {
      if (client?.connect === true) return;
      const socket = new SockJS("localhost:8080/ws");
      messages;
      if (client === null || client?.connected) setClient(Stomp.over(socket));
      }, []);
      useEffect(() => {
      if (client !== null) {
      client.connect({}, () => {
      client.subscribe("/topic/messages", (message) => {
      const receivedMessage = JSON.parse(message.body);
      console.log(messages);
      setMessages((messages) => [...messages, receivedMessage]);
      });
      });
      setStompClient(client);
      return () => {
      client.disconnect();
      };
      }
      }, [client]);

  • @mikhaelvanwellman28
    @mikhaelvanwellman28 4 месяца назад

    my sockJs error global
    why ??

    • @emersonperalesvillanueva8568
      @emersonperalesvillanueva8568 4 месяца назад

      I'm getting the same, why? I do not get the solution :c

    • @msbeigi83
      @msbeigi83 Месяц назад

      @@emersonperalesvillanueva8568 Are you guys using vite?

  • @user-qb9xx4kh5s
    @user-qb9xx4kh5s 11 месяцев назад

    Can you do it for private message?

    • @itgift-ht1ro
      @itgift-ht1ro  11 месяцев назад +1

      sure

    • @user-qb9xx4kh5s
      @user-qb9xx4kh5s 11 месяцев назад

      @@itgift-ht1ro are you gonna make a video of it or you will just update the repository on GitHub?