I am Sorry if my Question is Silly.
I am using ArrayBlockingQueue.
private ArrayBlockingQueue<RequestParameters> processorQueue;
private int sizeOfQueue = 3000;
Here, my Producer is seperate thread and Consumer is seperate Thread. both are running in Single Producer-Consumer Thread model.
Now, I am running my Java App, which gives request to my Servlet. Producer put the request in Queue. Consumer pics the request and start processing, which involves DB operations.(takes around 1 second to complete task)
Here, My Producer is getting request very fast and it fills Queue and wait until consumer start processing and make space in Queue.
My Question here is
- What best BlockingQueue Impl I should use, So that I will get best Performance.
- What will happen when Queue Size is Full, I mean Servlet will get request irrespective of Producer is waiting for Queue to get Vaccant. What about all those incoming Request? Where those request will go? are those request be stored in JVM Memory and given to Producer Thread once it is non-blocking?
Thanks.