code: private void processRecordsWithRetries(List<Record> records) {
          for (Record record : records) {
              boolean processedSuccessfully = false;
              for (int i = 0; i < NUM_RETRIES; i++) {
                  try {
                      //
                      // Logic to process record goes here.
                      //
                      processSingleRecord(record);
  
                      processedSuccessfully = true;
                      break;
                  } catch (Throwable t) {
                      LOG.warn("Caught throwable while processing record " + record, t);
                  }
  
                  // backoff if we encounter an exception.
                  try {
                      Thread.sleep(BACKOFF_TIME_IN_MILLIS);
                  } catch (InterruptedException e) {
                      LOG.debug("Interrupted sleep", e);
                  }
              }
  
              if (!processedSuccessfully) {
                  LOG.error("Couldn't process record " + record + ". Skipping the record.");
              }
          }
      }
docs: Process records performing retries as needed. Skip "poison pill" records.
  
  @param records Data records to be processed.