Description
We are having some issues with the Keen.io java client we are pushing a lot of events. those event are leagcy event and we are overriding the timestamp value of each event. We using the addEventAsync() method.
what we observed is that under load this does not work as expected and events are dropped.
protected Executor getDefaultPublishExecutor() throws Exception {
int procCount = Runtime.getRuntime().availableProcessors();
return Executors.newFixedThreadPool(procCount);
}
which returns a instances of ThreadPoolExecutor as per
public static ExecutorService newFixedThreadPool(int nThreads) {
return new ThreadPoolExecutor(nThreads, nThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue());
}
We think the TreadPoolExecutor implementation drops requests when all the threads are busy doing pushing event to keen.io
We cannot use sendQueuedEventsAsync() as we need to control the timestamp value of the events ?
I don't really understand (didn't look into it) why we cannot specified (override) the timestamp of the events when queuing them ?
any other suggestion on how we could this ?