title: Get spring transaction by it's ID and check status
body: <p>Is there any way to get current transaction id, store/pass it, and check it's status in the another part of application?</p>
  
  <p>For example:</p>
  
  <pre><code>@Service
  public class Service {
      ...
      @Transactional(rollbackFor = Exception.class)
      public void performAction(Action action) {
          // start action
          String transactionId = ???     // getting current transaction id
          messenger.send(transactionId); // sending transaction id to consumer
          // continue action
      } &lt;- commit transaction
  }
  
  public class Consumer {
      ...
      public void onRecieveMessage(String transactionId) {
          TransactionStatus ts = ??? // getting transaction from pool by id
          if (ts.isCompleted()) {
              // some actions
          } else {
              // wating or Future&lt;?&gt; or something else...
          }
      }
  }
  </code></pre>
  
  <p>(Actually, the problem is Consumer.onRecieveMessage executes earlier than action's transaction finishes, and data state is old)</p>