All Questions
14
questions
0
votes
0
answers
48
views
Stompjs + React application - Client connection closed automatically
I'm trying to use the stompjs library along with React application to establish a WebSocket connection with a server. However, I'm facing an issue where the connection is opened and closed immediately....
0
votes
0
answers
38
views
I am implementing real-time chat using web sockets, but the chat is not reflected in real time
The getChatMsg function is an API that brings previous chat history.
Even though it was invalidated with invalidateQueries, the chat history is not reflected in real time.
Even if you manage input ...
0
votes
0
answers
370
views
How to work with websockets in react js and spring boot application
I'm trying to connect with web socket which is on spring boot via React JS but not able to establish connection
I'm using the stompJS and sockjs-client libraries from npm
It's working while tested on ...
0
votes
0
answers
137
views
Error Resolving 'sockjs-client' and 'stompjs' in React and Spring Data Rest Project
I am following this React and Spring Data Rest tutorial and am currently at Part 4: https://spring.io/guides/tutorials/react-and-spring-data-rest
I have completed all the steps for Part 4. However, ...
-1
votes
1
answer
91
views
Recommended Approach When Building Notification Panel with WebSocket and React [closed]
I am building a notification panel using websocket and react. Should i use redux toolkit or useContext for managing centralize location of websockets? or is there any other suggested approach i can ...
0
votes
0
answers
99
views
Error while trying to import stompjs in a React application that is using webpack
I am building a modular federation React app that is subscribing to one of my topics from my backend using STOMP (SockJS) but whenever I try to import stompjs in one of my React components, it gives ...
0
votes
0
answers
50
views
Stomp js responsing twice
I have developed a chat application using spring boot web socket. In the front end I am using react. And I have installed these packages
"sockjs-client": "^1.6.1",
"stompjs&...
0
votes
1
answer
301
views
useEffect getting called multiple times in React without Strict mode
I want to run the connect function only once so that it initiates a stompjs client. But it is being called 4 times and I am getting the following message in the browser:
VM1867 bundle.js:41684 ...
1
vote
1
answer
172
views
Spring @SubscribeMapping being called
i am trying to make a webpage for multiplayer games similar to the jackbox party pack series.
I want to do this by creating sessions/rooms which are identified by a randomly generated 4 letter ...
2
votes
0
answers
179
views
React state is empty inside stomp callback function
I'm trying to update react state afte getting data from the websocket connection.
cont[myState,setState] = useState([array of some values]);
useEffect(() => {
if (d1 && d2) {
...
0
votes
0
answers
2k
views
@stomp/stompjs/esm6 connection in React is not working after porting to newest releases
I am doing my first react project, which is to port a demo web page what is using react 16 @stomp/stompjs/esm6 to talk to the back end. After recoding to use react 18.2 and the stomp 6 version, the ...
0
votes
1
answer
1k
views
React and Websocket messaging to server
So I'm having issues with a single component that displays a list pulled from a resource server. Then it uses Stompjs to establish a websocket and send messages. When I load the client, the Dev ...
0
votes
1
answer
683
views
Cannot read property 'publish' of undefined in react
Within my handleSubmit method if I hardcode the message and publish the method works as intended. However if I replace "hello stomp" with the input state or submit with any input at all I ...
0
votes
1
answer
1k
views
StompJs starting two websocket connections
React application, @stomp/stompjs library
If I start React app, it opens 2 websocket connections.
console log
network log
If I build and deploy it to server, it opens only one connection.
console log
...