HTTP request queue with worker pool

我与影子孤独终老i 提交于 2019-12-11 20:41:43

问题


I'm developing application in Java which connects to different web-servers via HTTP protocol (sends them request and waits for response). I would like to use pattern with queue and worker pool, so I'd like to know if there any frameworks in Java providing methods for this?


回答1:


I think what you're asking for is a threadpool. It has a queue of tasks and a number of threads working on those tasks. A little bit of googling for "java threadpool" landed me there, might be relevant. http://download.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int)

Threading can be messy if you aren't careful when designing, good luck :)




回答2:


Try java queue service like onlinemq.com or SQS



来源:https://stackoverflow.com/questions/3905349/http-request-queue-with-worker-pool

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!