TsgcWSPClient_STOMP_RabbitMQ › Methods › NACK
Rejects a previously received message so the broker can requeue or dead-letter it.
procedure NACK(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 rejected. |
aTransaction | const String | Optional transaction identifier; when supplied, the rejection is included in the named transaction and only takes effect on commit. |
NACK is the negative counterpart of ACK and tells RabbitMQ the message was not consumed successfully. Depending on the queue configuration the broker will requeue the message for redelivery or route it to the configured dead-letter exchange. Only valid for subscriptions created with ackClient or ackClient-Individual.
procedure TForm1.sgcRabbitMQMessage(Connection: TsgcWSConnection;
MessageText: String; Headers: TsgcWSRabbitMQSTOMPHeadersMessage;
Subscription: TsgcWSBrokerSTOMPSubscriptionItem);
begin
if not ProcessMessage(MessageText) then
sgcRabbitMQ.NACK(Headers.Ack);
end;