In the checklist for Compatible Application Check, there is a rule for maximum threads number.

Don't use more than 18 simultaneous threads to make API calls.

So I implemented to keep simultaneously request to eBay API gateway under 18 threads by using ThreadPoolExecutor.

package ebaytool.apicall;

import java.util.concurrent.*;

public class ApiCall implements Callable {
  
  public static ThreadPoolExecutor pool18;
  public static CompletionService ecs18;
  
  public ApiCall() throws Exception {
    
    if (pool18 == null) {
      pool18 = (ThreadPoolExecutor) Executors.newFixedThreadPool(18);
      ecs18 = new ExecutorCompletionService(pool18);
    }
    
  }
}
</pre>