TsgcWSPClient_AMQP1 › Events › OnAMQPBeforeWriteFrame
Fires for every AMQP 1.0 frame the client is about to emit, allowing inspection, last-moment edits or suppression.
property OnAMQPBeforeWriteFrame: TsgcAMQP1BeforeWriteFrameEvent;
// TsgcAMQP1BeforeWriteFrameEvent = procedure(Sender: TObject; const aFrame: TsgcAMQP1Frame; var Handled: Boolean) of object
—
Counterpart of OnAMQPBeforeReadFrame for outbound frames. aFrame is the fully populated performative the codec is about to encode and push to the transport (including Open, Begin, Attach, Flow, Transfer, Disposition, Detach, End, Close and SASL frames). Set Handled := True to cancel the write — useful to drop specific frames in tests, rewrite capabilities/properties or stub a response during offline simulations. Leaving Handled unchanged simply traces the frame without interfering. Runs inline on the calling thread.
procedure TForm1.oAMQP1AMQPBeforeWriteFrame(Sender: TObject;
const aFrame: TsgcAMQP1Frame; var Handled: Boolean);
begin
DoLog('#AMQP1 out: ' + aFrame.ClassName);
end;