TsgcWSPClient_STOMP_RabbitMQMethods › BeginTransaction

BeginTransaction Method

Starts a named STOMP transaction used to group SEND and ACK frames atomically.

Syntax

procedure BeginTransaction(const aTransaction: String);

Parameters

NameTypeDescription
aTransactionconst StringUnique identifier used to correlate subsequent SEND, ACK, NACK, COMMIT and ABORT frames that belong to the same transaction.

Remarks

STOMP transactions in RabbitMQ apply to sending and acknowledging frames: every SEND, ACK or NACK carrying the same transaction header is buffered by the broker and only processed when CommitTransaction is received. AbortTransaction discards all buffered frames.

Example

sgcRabbitMQ.BeginTransaction('tx-1');
sgcRabbitMQ.PublishQueue('orders', 'order-1', CS_TEXT_PLAIN, 'tx-1');
sgcRabbitMQ.PublishQueue('orders', 'order-2', CS_TEXT_PLAIN, 'tx-1');
sgcRabbitMQ.CommitTransaction('tx-1');

Back to Methods