I have created threadpool using ExecutorService
, in my application to call vendor websrvice, using below code.
ExecutorService executor = Executors.newFixedThreadPool(getThreadPoolSize());
for (int i = 0; i < list.size(); i++) {
Request ecpReq = list.get(i);
thRespLst.add(executor.submit(new Task(ecpReq)));
}
Wanted to know do we need to take care of shutting down threadpool or something, basically I don't want hanging threads in production environment.