@Asynchronous Calls

  • In a typical non-asynchronous method call, control is not returned to the client until the method has completed. But asynchronous methods return the call immediately without waiting for the method call to be completed. This allows clients to perform their own tasks while method finishes some long-running operations, processor-intensive background tasks, to increase performance of the application. E.g. Sending Mails/SMS to 1 million customers.
  • To let a method behave asynchronously you need to annotate the method with @Asynchronous annotation.
  • Asynchronous methods must return either void or an implementation of the Future interface.