title: Aspect Not working with Completable Future
body: <p>I have a list of Consumers which I want to run in multiple threads. I have an aspect for logging and handling all the exceptions. Below is the code snippet.</p>
  <p>The problem is that the aspect works fine till the point multiple threads are not created. After that in case of exception (<code>@LogFailure</code>) code doesn't enter the advice.</p>
  <pre><code>@Override
  public void consumerExecutor(Map&lt;Consumer&lt;IProcessDTO&gt;, IProcessDTO&gt; map, IContext context) {
      List&lt;CompletableFuture&lt;Void&gt;&gt; completableFutures = new ArrayList&lt;&gt;();
      Iterator consumerIterator = map.keySet().iterator();
  
      while (consumerIterator.hasNext()) {
          Consumer&lt;IProcessDTO&gt; consumer = (Consumer&lt;IProcessDTO&gt;) consumerIterator.next();
          CompletableFuture&lt;Void&gt; future = CompletableFuture.runAsync(() -&gt; {
              executeSingleConsumer(0, consumer,map.get(consumer));
          });
          completableFutures.add(future);
      }
  
      try {
          CompletableFuture&lt;Void&gt; allFuturesResult = CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()]));
          allFuturesResult.thenApply(v -&gt;
                  completableFutures.stream().
                          map(future -&gt; future.join()).
                          collect(Collectors.toList())
          );
      } catch (CancellationException | CompletionException exception) {
         
      }
  }
  
  
  @LogFailure
  @LogSuccess
  private void executeSingleConsumer(int tries, Consumer&lt;IProcessDTO&gt; consumer,IProcessDTO processDto) {
      try {
          consumer.accept(null);
      } catch (Exception ex) {
          if (tries &lt; maxAttempts) {
              executeSingleConsumer(tries + 1, consumer,processDto);
          } else if (tries == maxAttempts) {
              throw new ProcessException();
          } else {
              throw ex;
          }
      }
  }
  
  
  
  @AfterThrowing(pointcut = &quot;execution(@com.LogFailure * *.*(..))&quot;, argNames = &quot;jp,ex&quot;, throwing = &quot;ex&quot;)
  public void handleLogFailure(JoinPoint jp, Exception ex) {
      // exceptions handled
  }
  </code></pre>
  <p>Any idea what I am doing wrong?</p>