TsgcWSPClient_AMQP › Events › OnAMQPChannelFlow
Fires when the peer asks to pause or resume content traffic on a channel (channel.flow).
property OnAMQPChannelFlow: TsgcAMQPChannelFlowEvent;
// TsgcAMQPChannelFlowEvent = procedure(Sender: TObject; const aChannel: string; aFlow: Boolean; aAck: Boolean) of object
—
AMQP uses channel.flow to throttle a consumer when the broker is under pressure. aFlow is True when traffic must resume and False when it must stop (only heartbeats and connection/channel methods should be sent while stopped). aAck is True when the event reports the channel.flow-ok confirmation and False when it is the initial channel.flow request. Use this event to pause your publishing loop or to update a UI indicator.
procedure TForm1.oAMQPAMQPChannelFlow(Sender: TObject; const aChannel: string;
aFlow: Boolean; aAck: Boolean);
begin
if aFlow then
DoLog('#AMQP Channel ' + aChannel + ' flow resumed')
else
DoLog('#AMQP Channel ' + aChannel + ' flow paused');
end;