TsgcWSPClient_STOMP_RabbitMQ › Events › OnRabbitMQDisconnected
Fires when the RabbitMQ STOMP session is closed; reports the underlying WebSocket close code.
property OnRabbitMQDisconnected: TsgcWSRabbitMQDisconnectedEvent;
// TsgcWSRabbitMQDisconnectedEvent = procedure(Connection: TsgcWSConnection; Code: Integer) of object
—
Raised when the RabbitMQ STOMP session ends, either because the client called Disconnect (graceful shutdown after the matching RECEIPT) or because the underlying WebSocket connection was torn down. Parameters:
Use this event to update UI state, stop timers or trigger reconnection logic.
procedure TForm1.RabbitMQDisconnected(Connection: TsgcWSConnection; Code: Integer);
begin
Memo1.Lines.Add(Format('RabbitMQ disconnected (code=%d)', [Code]));
if Code <> 1000 then
Memo1.Lines.Add('Unexpected disconnect — will try to reconnect.');
end;