TsgcWSPClient_AMQPEvents › OnAMQPChallenge

OnAMQPChallenge Event

Fires when the broker sends a SASL challenge that the client must answer.

Syntax

property OnAMQPChallenge: TsgcAMQPChallengeEvent;
// TsgcAMQPChallengeEvent = procedure(Sender: TObject; const aChallenge: String; var Challenge: String) of object

Default Value

Remarks

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.

Example

procedure TForm1.oAMQPAMQPChallenge(Sender: TObject; const aChallenge: String;
  var Challenge: String);
begin
  DoLog('#AMQP Challenge: ' + aChallenge);
  Challenge := ComputeResponse(aChallenge);
end;

Back to Events