void ExecuteActionsAgainstRabbitMq(object sender, TransactionEventArgs transactionEventArgs) { var transactionInfo = transactionEventArgs.Transaction.TransactionInformation; if (transactionInfo.Status != TransactionStatus.Committed) { OutstandingOperations.Clear(); return; } var transactionId = transactionInfo.LocalIdentifier; if (!OutstandingOperations.ContainsKey(transactionId)) { return; } var actions = OutstandingOperations[transactionId]; if (!actions.Any()) { return; } ExecuteRabbitMqActions(actions); OutstandingOperations.Clear(); }
private void CommitTransaction(object sender, TransactionEventArgs e) { var transactionInfo = e.Transaction.TransactionInformation; if (transactionInfo.Status != TransactionStatus.Committed) { OutstandingOperations.Clear(); return; } var transactionId = transactionInfo.LocalIdentifier; if (!OutstandingOperations.ContainsKey(transactionId)) { return; } var messages = OutstandingOperations[transactionId]; if (!messages.Any()) { return; } var result = connectionManager.GetConnection() .AppendToStream(EndpointAddress.GetIntermediateOutgoingQueue(), ExpectedVersion.Any, messages); OutstandingOperations.Clear(); }