由於@Stefano博內蒂說,簡單的辦法解決這個很給力阿卡-HTTP通過配置使用不同的緩存池,例如,如果你使用singleRequest()API,您可以更改用戶代理,然後阿卡爲您創建不同的池,java中的代碼示例可以是:
UserAgent userAgent = UserAgent.create(ProductVersion.create("akka-http", "1.0", actorPath));
ConnectionPoolSettings setting = ConnectionPoolSettings.create(context().system())
.withConnectionSettings(ClientConnectionSettings.create(context().system())
.withUserAgentHeader(Optional.of(userAgent)));
http.singleRequest(httpRequest, http.defaultClientHttpsContext(), setting, context().system().log(), materializer).... Here code to handle the response