title: Create Retry template to retry on Connection timeout and read timeout
body: <p>I have integrated a rest template within my spring boot application. The rest template successfully establishes connection and read timeouts. I have also integrated a retry template to retry on these connection and read timeouts. The code for my retry template is below. I am having a problem with my code and cannot figure it out. Any insight would be very helpful.I am having an error with the "callback" it stating it could not be autowired and no beans were found. For 'FAILED' I am getting a cannot resolve symbol.</p>
  
  <pre><code> @Bean
  public RetryTemplate retryTemplate(RetryCallback&lt;RetryTemplate, Exception&gt; callback) {
      RetryTemplate template = new RetryTemplate();
      ExceptionClassifierRetryPolicy retryPolicy = new ExceptionClassifierRetryPolicy();
      Map&lt;Class&lt;? extends Throwable&gt;, Boolean&gt; retryableExceptions = new HashMap&lt;Class&lt;? extends Throwable&gt;, Boolean&gt;();
      retryableExceptions.put(SocketTimeoutException.class, Boolean.TRUE);
      retryableExceptions.put(ConnectionPoolTimeoutException.class, Boolean.TRUE);
      retryableExceptions.put(ResourceAccessException.class, Boolean.TRUE);
  
      NeverRetryPolicy doNotRetry = new NeverRetryPolicy();
      SimpleRetryPolicy simpleRetryPolicy = new SimpleRetryPolicy(maxAttempts, retryableExceptions);
      simpleRetryPolicy.setMaxAttempts(maxAttempts);
  
  
      FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
      backOffPolicy.setBackOffPeriod(backOffPeriod);
  
      template.setRetryPolicy(simpleRetryPolicy);
      template.setBackOffPolicy(backOffPolicy);
  
      try {
          return template.execute(callback);
      } catch (Exception e) {
          logger.error("Retry processing failed " + e.getMessage());
          return RetryTemplate.FAILED;
      }
  }
  </code></pre>