TsgcWSPClient_STOMP_ActiveMQ › Events › OnActiveMQDisconnected
Fires when the ActiveMQ STOMP session is closed; reports the underlying WebSocket close code.
property OnActiveMQDisconnected: TsgcWSActiveMQDisconnectedEvent;
// TsgcWSActiveMQDisconnectedEvent = procedure(Connection: TsgcWSConnection; Code: Integer) of object
—
Raised when the ActiveMQ 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.ActiveMQDisconnected(Connection: TsgcWSConnection; Code: Integer);
begin
Memo1.Lines.Add(Format('ActiveMQ disconnected (code=%d)', [Code]));
if Code <> 1000 then
Memo1.Lines.Add('Unexpected disconnect — will try to reconnect.');
end;