title: Java/Spring library services async
body: <p>i have created a java/spring library offering reusable functions like calling an ldap service to check if a user is authenticated to a given directory service.</p>
  
  <p>The library is working and i can integrate it to any given java project via maven or use the api with rest.</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li>I want to call that library service let´s say <code>public boolean authenticateUser(String login, String password)</code> asynchronous. Do i code that service within the library asynchronous or should the consuming app do the asynchronous call?</li>
  <li>Because it is a spring (boot) utilized library i have defined a dedicated <code>ThreadPoolTaskExecutor</code> bean within the library. Is this a good idea (a dedicated <code>ThreadPoolTaskExecutor</code>) or should the consuming app do the defining of the <code>ThreadPoolExecutor</code></li>
  </ol>