TsgcWSPClient_STOMP_ActiveMQ › Events › OnActiveMQDisconnected

OnActiveMQDisconnected Event

Fires when the ActiveMQ STOMP session is closed; reports the underlying WebSocket close code.

Syntax

property OnActiveMQDisconnected: TsgcWSActiveMQDisconnectedEvent;
// TsgcWSActiveMQDisconnectedEvent = procedure(Connection: TsgcWSConnection; Code: Integer) of object

Default Value

—

Remarks

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.

Example

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;

Back to Events