TsgcWSPClient_AMQP › Events › OnAMQPException
Fires when an unhandled exception is raised inside the AMQP protocol or reader thread.
property OnAMQPException: TsgcAMQPExceptionEvent;
// TsgcAMQPExceptionEvent = procedure(Sender: TObject; E: Exception) of object
—
Raised when a protocol error, a frame parsing failure or any exception is caught while processing AMQP data. The E parameter holds the original exception so you can log its message and class name. Because AMQP frames are read from a background thread, this handler is invoked synchronized with that thread — keep the handler short and thread-safe. The connection is not automatically closed; check aClose.ReplyCode in OnAMQPDisconnect if the server also terminates the session.
procedure TForm1.oAMQPAMQPException(Sender: TObject; E: Exception);
begin
DoLog(Format('#AMQP Exception: %s - %s', [E.ClassName, E.Message]));
end;