TsgcWSPClient_STOMP_RabbitMQ › Events › OnRabbitMQConnected
Fires after the RabbitMQ broker answers the CONNECT frame with a CONNECTED frame; exposes the negotiated session via a typed Headers object.
property OnRabbitMQConnected: TsgcWSRabbitMQSTOMPConnectedEvent;
// TsgcWSRabbitMQSTOMPConnectedEvent = procedure(Connection: TsgcWSConnection; Headers: TsgcWSRabbitMQSTOMPHeadersConnected) of object
—
Raised when RabbitMQ 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.RabbitMQConnected(Connection: TsgcWSConnection;
Headers: TsgcWSRabbitMQSTOMPHeadersConnected);
begin
Memo1.Lines.Add(Format('RabbitMQ %s connected to %s (session=%s, heart-beat=%s)',
[Headers.Version, Headers.Server, Headers.Session, Headers.HeartBeat]));
// now it is safe to subscribe
RabbitMQ.SubscribeQueue('orders');
end;