TsgcWSPClient_STOMP_RabbitMQMethods › ACK

ACK Method

Acknowledges consumption of a message previously received from a subscription.

Syntax

procedure ACK(const aId: string; const aTransaction: String = '');

Parameters

NameTypeDescription
aIdconst stringValue of the ack header carried by the incoming MESSAGE frame; identifies the message being acknowledged.
aTransactionconst StringOptional transaction identifier; when supplied, the acknowledgement is included in the named transaction and only takes effect on commit.

Remarks

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.

Example

procedure TForm1.sgcRabbitMQMessage(Connection: TsgcWSConnection;
  MessageText: String; Headers: TsgcWSRabbitMQSTOMPHeadersMessage;
  Subscription: TsgcWSBrokerSTOMPSubscriptionItem);
begin
  sgcRabbitMQ.ACK(Headers.Ack);
end;

Back to Methods