Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'publish' of undefined when app goes on background for long #526

Open
Globewyze1 opened this issue Feb 21, 2023 · 1 comment

Comments

@Globewyze1
Copy link

Getting error on publish when user send message after long time stying on the background. What could be the reason

if (stompClientState) {
stompClientState.publish({ destination: "/app/subscribeUser", headers: { 'content-type': "application/json;charset=UTF-8" }, body: JSON.stringify(messageObj) });

}

@kum-deepak
Copy link
Member

The underlying connection may drop for various reasons, and the library will reconnect. However, occasionally, there may be no underlying connection. When using this library, you need to check, before operations, if there is an active broker connection.

If you find it complicated, the wrapper @stopm/rx-stomp hides this complexity among other goodies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants