title: Spring Data Repository Async Save
body: <p>I have a service using Spring Data Redis and the <code>CrudRepository</code>, and within one of my service methods it performs a query and then a save. I want to make the save asynchronous. Is it possible to make the save method in my extended <code>CrudRepository</code> asynchronous?</p>
  
  <p>With the example below I want the <code>save</code> operation to be asynchronous.</p>
  
  <pre><code>public interface MyRepository extends CrudRepository&lt;User, String&gt; {
      public List&lt;User&gt; findByUserId(Long userId);
  }
  
  public class MyServiceImpl implements MyService {
  
      @Autowired
      private MyRepository myRepository;
  
      public void addUser(User newUser) {
          List&lt;User&gt; users = myRepository.findByUserId(newUser.getUserId());
          // other operations on users
          myRepository.save(); // want this be async
      }
  }
  </code></pre>