private void writeEntry(HttpRequestWriter writer, int index) {
      if (index == entries.size()) { // out of entries.
        writer.close();
        return;
      }
      // Write the current entry directly to the current request.
      if (!writer.tryWrite(HttpData.wrap(serialize(alloc, entries.get(index), shouldAddType)))) {
        // Stream aborted, no need to serialize anymore.
        return;
      }
      // Recurse to proceed to the next entry, if any.
      writer.whenConsumed().thenRun(() -> writeEntry(writer, index + 1));
    }
Creates a bulk request when there is more than one object to store
zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/internal/BulkCallBuilder.java