TsgcWSPClient_AMQP1Events › OnAMQPException

OnAMQPException Event

Fires when an unhandled exception is raised while processing AMQP 1.0 frames.

Syntax

property OnAMQPException: TsgcAMQP1ExceptionEvent;
// TsgcAMQP1ExceptionEvent = procedure(Sender: TObject; E: Exception) of object

Default Value

Remarks

Raised when a protocol error, a frame decoding failure or any exception escapes while reading AMQP 1.0 frames from the transport, and also when a user handler raises. E is the original exception — log its ClassName and Message. Frames are dispatched on a background reader thread, so the handler runs off the main thread: keep work short and use TThread.Synchronize to touch UI state. The component disables the underlying client (Client.Active := False) after firing, which will in turn raise OnAMQPDisconnect.

Example

procedure TForm1.oAMQP1AMQPException(Sender: TObject; E: Exception);
begin
  DoLog(Format('#AMQP1 exception: %s - %s', [E.ClassName, E.Message]));
end;

Back to Events