TsgcWSPClient_STOMP_ActiveMQMethods › ACK

ACK Method

Sends an ACK frame acknowledging the successful consumption of a message.

Syntax

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

Parameters

NameTypeDescription
aIdconst stringValue of the ack header (STOMP 1.2) or message-id (STOMP 1.1) received in the MESSAGE frame being acknowledged.
aTransactionconst StringOptional transaction id; when set the ACK participates in an ongoing transaction and only takes effect on COMMIT.

Remarks

Only required when the subscription was opened with ackClient or ackClientIndividual. In ackClient mode the ACK is cumulative and also acknowledges every prior unacked message on the same subscription; in ackClientIndividual mode only the referenced message is acknowledged. When aTransaction is supplied the ACK is buffered and released when CommitTransaction is called.

Example

procedure TForm1.oActiveMQMessage(Sender: TObject; aConnection: TsgcWSConnection; const aMessage: TsgcSTOMPMessage);
begin
  oActiveMQ.ACK(aMessage.Ack);
end;

Back to Methods