TsgcWSPClient_AMQP › Events › OnAMQPBasicGetOk
Fires when a synchronous basic.get call returns a message (basic.get-ok).
property OnAMQPBasicGetOk: TsgcAMQPBasicGetOkEvent;
// TsgcAMQPBasicGetOkEvent = procedure(Sender: TObject; const aChannel: string; const aGetOk: TsgcAMQPFramePayload_Method_BasicGetOk; const aContent: TsgcAMQPMessageContent) of object
—
Raised in response to a GetMessage pull request when a message was available. aGetOk exposes the delivery tag, redelivered flag, exchange, routing key and the number of messages still sitting in the queue (MessageCount). aContent holds the message properties and payload. If instead the queue is empty the client raises OnAMQPBasicGetEmpty.
procedure TForm1.oAMQPAMQPBasicGetOk(Sender: TObject; const aChannel: string;
const aGetOk: TsgcAMQPFramePayload_Method_BasicGetOk;
const aContent: TsgcAMQPMessageContent);
begin
DoLog(Format('#AMQP GetOk [%s] remaining=%d: %s',
[aChannel, aGetOk.MessageCount, aContent.Body.AsString]));
oAMQP.BasicAck(aChannel, aGetOk.DeliveryTag);
end;