Extends React.Component
Connect to the server if not connected. Under normal circumstances component will automatically try to connect to server. This method is mostly useful after component is explicitly disconnected via SockJsClient#disconnect.
Disconnect STOMP client and disable all reconnect.
Send message to the specified topic.
topic
string target topic to send messagemsg
string message to sendopt_headers
Object additional headers for underlying STOMP client (optional, default{}
)
HTTP URL of the endpoint to connect.
- See: SockJS-options
Additional options to pass to the underlying SockJS constructor.
Array of topics to subscribe to.
Callback after connection is established.
Callback after connection is lost.
Gets called to find the time interval for next retry. Defaults to a function returing retryCount seconds.
retryCount
number number of retries for the current disconnect
Callback when a message is recieved.
msg
(string | Object) message received from server, if JSON format then objecttopic
string the topic on which the message was received
Headers that will be passed to the server or broker with STOMP's connection frame.
Headers that will be passed when subscribing to a destination.
Should the client try to automatically connect in an event of disconnection.
Enable debugging mode.
Number of milliseconds to send and expect heartbeat messages.
Number of milliseconds to expect heartbeat messages
Number of milliseconds to send heartbeat messages
Callback when connection could not be established
error
(Object) error throwed by the SockJs Client