TsgcWSPClient_STOMP_RabbitMQ › Methods › ACK
Acknowledges consumption of a message previously received from a subscription.
procedure ACK(const aId: string; const aTransaction: String = '');
| Name | Type | Description |
|---|---|---|
aId | const string | Value of the ack header carried by the incoming MESSAGE frame; identifies the message being acknowledged. |
aTransaction | const String | Optional transaction identifier; when supplied, the acknowledgement is included in the named transaction and only takes effect on commit. |
Call ACK from the OnRabbitMQMessage handler whenever the subscription was registered with ackClient or ackClient-Individual. The aId argument must be the value of the ack header of the MESSAGE frame, not the message-id. Subscriptions created with ackAuto do not require ACK.
procedure TForm1.sgcRabbitMQMessage(Connection: TsgcWSConnection;
MessageText: String; Headers: TsgcWSRabbitMQSTOMPHeadersMessage;
Subscription: TsgcWSBrokerSTOMPSubscriptionItem);
begin
sgcRabbitMQ.ACK(Headers.Ack);
end;