我ExecutorService在我的应用程序中使用下面的代码创建了threadpool ,用于调用供应商websrvice.
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)));
}
Run Code Online (Sandbox Code Playgroud)
想要知道我们需要关注线程池或其他东西,基本上我不想在生产环境中挂线程.
我需要创建一个过滤器并修改请求对象中设置的标头值。我们如何使用Filter修改请求对象中的标头?请求对象中没有可用的setHeader方法。