TsgcWSPClient_AMQP1Events › OnAMQPBeforeWriteFrame

OnAMQPBeforeWriteFrame Event

Fires for every AMQP 1.0 frame the client is about to emit, allowing inspection, last-moment edits or suppression.

Syntax

property OnAMQPBeforeWriteFrame: TsgcAMQP1BeforeWriteFrameEvent;
// TsgcAMQP1BeforeWriteFrameEvent = procedure(Sender: TObject; const aFrame: TsgcAMQP1Frame; var Handled: Boolean) of object

Default Value

Remarks

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.

Example

procedure TForm1.oAMQP1AMQPBeforeWriteFrame(Sender: TObject;
  const aFrame: TsgcAMQP1Frame; var Handled: Boolean);
begin
  DoLog('#AMQP1 out: ' + aFrame.ClassName);
end;

Back to Events