Hi,
I am new to coderanch forum.I have 3 years of
Java exp and i never worked on threads.
Here is the high level overivew of my code that I have created.
• Create Executor service for Producer to pick up the records using Linked blocking queue..
• Once the records have been taken up by the producer, it will form like multiple array list and each one will have 100000 records.
• Using ThreadPoolExecutor, multiple Consumer Threads is getting triggered and Process the array list of records sequentially.
• All records have been processed then the loop continues to take up the upcoming records.
Issues I'm facing
-If there are 300000 records the queue has taken 100000 records in each index(configurable),my consumer code will took only 100000 records and suddenly my TPE get shutting down.
There are two class files that I have developed.
1.Reader.java
2.Producer.java
Reader.java will take a file, producer.java puts up in the Linked blocking queue.
Once queue is getting filled,using
Thread pool executor i will create mulitple consumers to taken up the records for processing.
Please find the attached code .It would be great if anyone could solve my crictical issue.Forgive me if any typo is there
Sincerely,
Hari.
Reader.Java
-----------------
Producer.Java
------------------