withTransaction
suspend fun <T> StompSession.withTransaction(block: suspend StompSession.(transactionId: String) -> T): T(source)
Executes the given block as part of a transaction.
This method automatically generates an ID for the new transaction and sends a BEGIN frame. The given block is given the generated transaction ID as parameter. The receiver of the given block is a special StompSession that automatically fills the transaction
header (if absent) for all SEND, ACK, and NACK frames.
The transaction is committed if the block executes successfully, and aborted in case of exception. Any exception thrown by the block is re-thrown after sending the ABORT frame.