You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I can't get SockJS Client to subscribe to the 'initial/queue' and 'dashboard/livestream' topic. I only get 'topic/livestream', no matter what I do.
Here is my code snippet, and also a reminder that in the backend everything is configured fine, so the problem is somewhere either in this logic or in SockJs library. Please help!
import React from 'react';
import SockJsClient from 'react-stomp';
Hi, I can't get SockJS Client to subscribe to the 'initial/queue' and 'dashboard/livestream' topic. I only get 'topic/livestream', no matter what I do.
Here is my code snippet, and also a reminder that in the backend everything is configured fine, so the problem is somewhere either in this logic or in SockJs library. Please help!
import React from 'react';
import SockJsClient from 'react-stomp';
class TableDataStream extends React.Component {
constructor(props) {
super(props);
this.state = {
clientConnected: false,
messages: [],
data: [],
circulatingSupply: '',
figures: '',
initialDataReceived: false
};
}
componentDidMount() {
this.setState({ clientConnected: true });
}
componentWillUnmount() {
this.setState({ clientConnected: false });
}
sendMessage = () => {
if (this.clientRef && this.clientRef.state && this.clientRef.state.connected) {
console.log(this.clientRef);
console.log(this.clientRef.state);
console.log(this.clientRef.state.connected);
this.clientRef.sendMessage('/dashboard/livestream', {});
}
};
handleMessage = (event) => {
if (event.topic === '/queue/initial') {
};
handleDisconnect = () => {
console.log('SockJSClient is disconnected');
};
render() {
const { initialDataReceived, clientConnected } = this.state;
}
}
export default TableDataStream;
The text was updated successfully, but these errors were encountered: