TsgcWSPClient_AMQP › Events › OnAMQPChallenge
Fires when the broker sends a SASL challenge that the client must answer.
property OnAMQPChallenge: TsgcAMQPChallengeEvent;
// TsgcAMQPChallengeEvent = procedure(Sender: TObject; const aChallenge: String; var Challenge: String) of object
—
Some SASL mechanisms require additional rounds after connection.start-ok. When the broker sends a connection.secure frame the client forwards the challenge data through this event. Inspect aChallenge, compute the response expected by the mechanism and assign it to Challenge; the client will then reply with connection.secure-ok.
procedure TForm1.oAMQPAMQPChallenge(Sender: TObject; const aChallenge: String;
var Challenge: String);
begin
DoLog('#AMQP Challenge: ' + aChallenge);
Challenge := ComputeResponse(aChallenge);
end;