如何在web和spring中使用STOMP心跳?

如何在web和spring中使用STOMP心跳?,spring,stomp,heartbeat,Spring,Stomp,Heartbeat,现在我使用stomp从web连接到服务器 我知道STOMP在v1.1之后有心跳机制,而且我已经成功地设置了它。但我不知道如何检测/捕捉乒乓球框架并处理它 web中的代码如下所示: this.stomp = Stomp.client(this.wsUrl); this.stomp.heartbeat.outgoing = 5000; this.stomp.heartbeat.incoming = 5000; this.stomp.connect({}, (frame

现在我使用stomp从web连接到服务器

我知道STOMP在v1.1之后有心跳机制,而且我已经成功地设置了它。但我不知道如何检测/捕捉乒乓球框架并处理它

web中的代码如下所示:

    this.stomp = Stomp.client(this.wsUrl);
    this.stomp.heartbeat.outgoing = 5000;
    this.stomp.heartbeat.incoming = 5000;
    this.stomp.connect({}, (frame: any) => {
    // ...
    }, (error: any) => {
    // ...
    });
服务器中的代码如下所示。我们用弹簧跺脚

    public void configureMessageBroker(MessageBrokerRegistry config) {
    config.enableSimpleBroker("/topic")
            .setTaskScheduler(new DefaultManagedTaskScheduler())
            .setHeartbeatValue(new long[] {5000, 5000});
    config.setApplicationDestinationPrefixes("/signal");
}

我可以在控制台面板上看到镀铬的乒乓球拍框。

您找到解决问题的方法了吗?我在我的项目中也面临同样的问题?我不知道春天怎么用它?不,我还是自己送心跳。你自己送吗?我以为是图书馆寄的?您想如何处理乒乓球框架?我希望它可以根据我的配置自动断开或重新连接。但它只发送ping/ping消息。连我都不知道怎么写这条信息的触发器。嗨。你有没有找到解决办法?我也有同样的问题。正在发送Ping消息,但我不知道如何处理超时。