TsgcWSPClient_STOMP_ActiveMQEvents › OnActiveMQConnected

OnActiveMQConnected Event

Fires after the ActiveMQ broker answers the CONNECT frame with a CONNECTED frame; exposes the negotiated session via a typed Headers object.

Syntax

property OnActiveMQConnected: TsgcWSActiveMQSTOMPConnectedEvent;
// TsgcWSActiveMQSTOMPConnectedEvent = procedure(Connection: TsgcWSConnection; Headers: TsgcWSActiveMQSTOMPHeadersConnected) of object

Default Value

Remarks

Raised when Apache ActiveMQ answers the CONNECT / STOMP frame with a CONNECTED frame. This is the first moment at which the STOMP session is fully usable — it is safe to call Subscribe / Send / BeginTransaction from inside this handler. Parameters:

Example

procedure TForm1.ActiveMQConnected(Connection: TsgcWSConnection;
  Headers: TsgcWSActiveMQSTOMPHeadersConnected);
begin
  Memo1.Lines.Add(Format('ActiveMQ %s connected to %s (session=%s, heart-beat=%s)',
    [Headers.Version, Headers.Server, Headers.Session, Headers.HeartBeat]));

  // now it is safe to subscribe
  ActiveMQ.Subscribe('/queue/orders');
end;

Back to Events