title: Supervisor of akka doesn't work correctly with RestTemplate
body: <p>I'm using akka with Java and Spring. And my main goal is notify other application in a asynchronous way. But sometimes this other app isn't notified. So, I implemented a Supervisor to make use of retries. But, when I receive an Exception, specifically InternalServerErrorException my supervisor does not make another retry. Seems that the RestTemplate and your treatement of exceptions is causing the problem.
  Below follows my code:</p>
  
  <pre><code>@Scope(SCOPE_PROTOTYPE)
  public class NotificacaoSupervisor extends AbstractActor {
  
      private static final int RETRIES = 5;
  
      private OneForOneStrategy  ONE_FOR_ONE_STRATEGY = new OneForOneStrategy(
              RETRIES,
              Duration.create("5 minutes"),
              true,
              DeciderBuilder.match(NotificacaoException.class, ex -&gt; SupervisorStrategy.restart())
                        .build());
  
  
      @Inject @Qualifier("notifyActor")
      private ActorRef notifyActor;
  
  
  
      @Override
      public Receive createReceive() {
      return receiveBuilder()
              .matchAny(any -&gt; notifyActor.forward(any, getContext()))
              .build();
      }
  
      @Override
      public SupervisorStrategy supervisorStrategy() {
      return ONE_FOR_ONE_STRATEGY;
      }
  }
  </code></pre>
  
  <p>Block that sends a notification</p>
  
  <pre><code>try{
         if(content.isPresent()) {
             this.logInfo(content.get());
             HttpEntity&lt;String&gt; entity = new HttpEntity&lt;&gt;(content.get(), headers);
             String urlDeCallback = integracao.getUrlDeCallback();
             URI uri = URI.create(urlDeCallback);
             restTemplate.postForObject(uri, entity, Void.class);
         }
  
  } catch (Exception e) {
    this.logError(new ErrorResponse(notificacao).toString(), e);
    throw new NotificacaoException(e);
  }
  </code></pre>