Commands | AMQP QoS

AMQP allows to set a QoS level to limit the number of messages the server sends to the client before wait to get the acknowledgment of the messages.

 

Set QoS

The method SetQoS is used to limit the number messages the server sends to the AMQP client.

The method has the following arguments:

 

 

The response from the server is received OnAMQPBasicQoS event.


AMQP.SetQoS('channel_name', 1024000, 100, false);
 
procedure OnAMQPBasicQoS(Sender: TObject; const aChannel: string; 
  const aQoS: TsgcAMQPFramePayload_Method_BasicQoS);
begin
  DoLog('#AMQP_basic_qos: ' + aChannel + ' ' + IntToStr(aQoS.PrefetchSize) + ' '
    + IntToStr(aQoS.PrefetchCount) + ' ' + BoolToStr(aQoS.Global));
end;

 

A Synchronous call can be done just calling the method SetQoSEx, this method returns true if the request has been processed, otherwise the result will be false.