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

stomp连接时发生服务端异常,重连过程中异常,导致stomp状态异常 #63

Closed
sanpark opened this issue May 18, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sanpark
Copy link

sanpark commented May 18, 2022

 public synchronized Stomp connect(List<Header> headers) {
        if (connected || connecting) {
            return this;
        }
        websocket = task
            .setOnOpen((ws, res) -> doOnOpened(headers))
            .setOnMessage((ws, msg) -> msgCodec.decode(msg.toString(), this::receive))
            .setOnException((ws, e) -> doOnException(e))
            .setOnClosed((ws, close) -> doOnClosed(close))
            .listen();
        connecting = true;
        disconnecting = false;
        return this;
    }

断点发现一个问题,
1.正常运行状态下,断开服务器,会调用onclosed
2.断开立马进行重连,会回调onexception报服务器502错误,connecting被设置成false
3.稍后再次进行stomp.connect() 服务器还没有重启好 connecting被设置成了true,然后onexception也不回调,导致connecting一直是true,然后connect的时候一直return this 无法重新连接

@troyzhxu troyzhxu added the bug Something isn't working label May 18, 2022
@troyzhxu
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants