code: public void drain(final HttpClient httpClient, final String path, final boolean gzip) {
  		
  		if (!resendQueue.isEmpty()) {
  			
  			// queued items are available for retransmission
  			
  			try {
  				// drain resend queue until empty or first exception
  				
  				LOGGER.info("Attempting to retransmit {} requests", resendQueue.size());
  				
  				while (!resendQueue.isEmpty()) {
  					
  					// get next item off queue
  					
  					HttpResendQueueItem item = resendQueue.peek();
  					
  					try {
  						
  						// retransmit queued request
  						
  						byte[] jsonBytes = item.getJsonBytes();
  						httpClient.post(path, jsonBytes, gzip);
  						
  						// retransmission successful
  						// remove from queue and sleep for 250ms
  						
  						resendQueue.remove();
  						
  						Threads.sleepQuietly(250, TimeUnit.MILLISECONDS);
  						
  					} catch (Throwable t) {
  						
  						// retransmission failed
  						// increment the item's counter
  						
  						item.failed();
  						
  						// remove it from the queue if we have had MAX_POST_ATTEMPTS (3) failures for the same request
  						
  						if (MAX_POST_ATTEMPTS <= item.getNumFailures())
  						{
  							resendQueue.remove();
  						}
  						
  						// rethrow original exception from retransmission
  						
  						throw t;
  					}
  				}
  			} catch (Throwable t) {
  				LOGGER.info("Failure retransmitting queued requests", t);
  			}
  		}
  	}
docs: Drains the resend queue until empty or error
  @param httpClient The HTTP client
  @param path REST path
  @param gzip True if the post should be gzipped, false otherwise