playframework 1.4中的连接超时
当使用Unirest库从一个控制器向另一个控制器发出GET请求时,我总是有连接超时 应用程序运行于playframework 1.4中的连接超时,playframework,playframework-1.x,unirest,Playframework,Playframework 1.x,Unirest,当使用Unirest库从一个控制器向另一个控制器发出GET请求时,我总是有连接超时 应用程序运行于 http://localhost:9000 我在斜杠扩展控制器中的代码是: String URL = "http://localhost:9000/api/link/HZbeTR"; Logger.info("Requesting API. URL: %s. ObjectRef: %s", URL, objectRef); HttpResponse<String> apiRes
http://localhost:9000
我在斜杠扩展控制器中的代码是:
String URL = "http://localhost:9000/api/link/HZbeTR";
Logger.info("Requesting API. URL: %s. ObjectRef: %s", URL, objectRef);
HttpResponse<String> apiResponse = Unirest.get(URL).asString();
路径/api/link/{str}
路由到另一个类扩展控制器
直接向http://localhost:9000/api/link/HZbeTR
,只有几毫秒,我有响应
我调试了网络,发现没有像GET这样的请求http://localhost:9000/api/link/HZbeTR
我还把
stringurl=”放进去http://yandex.ru“
和Unirest确实成功地请求了Yandex。在开发模式下,执行池大小为1,因此您实际上是在阻止自己。如果增加池大小,则应修复此问题。有关更多信息,请参阅位于的文档
play.pool=2
NB您可能需要明确定义此设置适用的模式
play.pool=2