TsgcWSPClient_STOMP_ActiveMQ › Events › OnActiveMQConnected
Fires after the ActiveMQ broker answers the CONNECT frame with a CONNECTED frame; exposes the negotiated session via a typed Headers object.
property OnActiveMQConnected: TsgcWSActiveMQSTOMPConnectedEvent;
// TsgcWSActiveMQSTOMPConnectedEvent = procedure(Connection: TsgcWSConnection; Headers: TsgcWSActiveMQSTOMPHeadersConnected) of object
—
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:
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;