TsgcWSPClient_AMQPEvents › OnAMQPQueueDeclare

OnAMQPQueueDeclare Event

Fires when the server confirms that a queue has been declared (queue.declare-ok).

Syntax

property OnAMQPQueueDeclare: TsgcAMQPQueueDeclareEvent;
// TsgcAMQPQueueDeclareEvent = procedure(Sender: TObject; const aChannel, aQueue: string; aMessageCount, aConsumerCount: Integer) of object

Default Value

Remarks

Raised in response to DeclareQueue. aQueue is the name of the queue (if the declare was passive or auto-generated, the server may echo back a different name). aMessageCount is the number of messages already in the queue and aConsumerCount is the number of active consumers on it. Use these counters to decide whether to bind, purge or start consuming straight away.

Example

procedure TForm1.oAMQPAMQPQueueDeclare(Sender: TObject;
  const aChannel, aQueue: string; aMessageCount, aConsumerCount: Integer);
begin
  DoLog(Format('#AMQP Queue declared: %s (messages=%d consumers=%d)',
    [aQueue, aMessageCount, aConsumerCount]));
end;

Back to Events