TsgcWSPClient_STOMP_ActiveMQMethods › NACK

NACK Method

Sends a NACK frame telling the server the message was not consumed.

Syntax

procedure NACK(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 rejected.
aTransactionconst StringOptional transaction id; when set the NACK participates in an ongoing transaction and only takes effect on COMMIT.

Remarks

NACK is the opposite of ACK: it informs the ActiveMQ broker the message could not be processed so it can redeliver or dead-letter it. Only valid on subscriptions opened with ackClient or ackClientIndividual. Broker-specific behaviour (redelivery count, DLQ routing) depends on the ActiveMQ server configuration. When aTransaction is supplied the NACK is deferred until CommitTransaction.

Example

oActiveMQ.NACK(aMessage.Ack);

Back to Methods