Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StompBrokerRelayMessageHandler - many log errors

We use spring websockets with tomcat 7 over stomp and sockjs. Our log is filled with errors of such:

[WEBAPP] 16 Aug 2015 08:11:24 ERROR StompBrokerRelayMessageHandler - Failed to forward DISCONNECT session=7ufvyfvf
[WEBAPP] 16 Aug 2015 08:13:47 ERROR StompBrokerRelayMessageHandler - Failed to forward DISCONNECT session=d017bxnq

Any ideas why? and how can we remove\mitigate this?

like image 938
Urbanleg Avatar asked Jan 07 '23 18:01

Urbanleg


1 Answers

Sorry, I'm a little bit late. Nevertheless, was confronted with the same/similar problem. I guess you're using a messagebroker like rabbitmq.

ERROR StompBrokerRelayMessageHandler:584 - TCP connection failure in session uwdglayp: Transport failure: Connection reset by peer

Sometimes it is a forward failure, often connection failure.

What did I do? After changing the logging level to debug, I figured out, that the spring application sends two DISCONNECT messages to the messagebroker.

Calling stomp.disconnect() on client side results in sending a DISCONNECT message (STOMP) and in closing the socket (socketJS).

The StompBrokerRelayMessageHandler informs the Broker about the DISCONNECT message and additionally sends a DISCONNECT, because the socket was closed by the client, both async. There is no chance that Spring can catch the second disconnect and the second disconnect will occur in an error.

What specifies STOMP? (DISCONNECT SPEC)

A client can disconnect from the server at anytime by closing the socket but there is no guarantee that the previously sent frames have been received by the server

My solution: Modify the STOMP Client and just close the socket without sending a DISCONNECT message (client will close socket)

Another solution: Send only a DISCONNECT message (spring will close socket)

I'll check other implementations of STOMP to find a better solution.

like image 185
wollodev Avatar answered Jan 15 '23 03:01

wollodev